Skip to content

SDK Overview ​

Logstyx provides JavaScript SDKs for various platforms and frameworks, making it easy to integrate logging into your applications. All SDKs are built on top of logstyx-js-core and provide a consistent API across different environments.

Available SDKs ​

Core SDK ​

The foundation for all platform-specific SDKs. Use this if you're building a custom integration or need maximum flexibility.

Repository: logstyx-js-core

bash
npm install github:devatlogstyx/logstyx-js-core#release

When to use Core SDK

  • Building a custom integration for a framework not yet supported
  • Need low-level control over logging behavior
  • Creating your own wrapper around Logstyx

Node.js SDK ​

For server-side Node.js applications. Includes automatic uncaught exception and unhandled rejection capture.

Repository: logstyx-js-node

bash
npm install github:devatlogstyx/logstyx-js-node#release

Best for: Backend services, APIs, CLI tools, serverless functions

Express SDK ​

Middleware for Express.js applications with automatic request logging.

Repository: logstyx-js-express

bash
npm install github:devatlogstyx/logstyx-js-express#release

Best for: Express.js web servers and REST APIs

Browser SDK ​

Lightweight SDK for vanilla JavaScript in the browser.

Repository: logstyx-js-browser

bash
npm install github:devatlogstyx/logstyx-js-browser#release

Best for: Static websites, vanilla JS applications

React SDK ​

React hooks and components for seamless integration.

Repository: logstyx-js-react

bash
npm install github:devatlogstyx/logstyx-js-react#release

Best for: React web applications

React Native SDK ​

Optimized for React Native mobile applications.

Repository: logstyx-js-react-native

bash
npm install github:devatlogstyx/logstyx-js-react-native#release

Best for: iOS and Android mobile apps built with React Native

Common Features ​

All Logstyx SDKs share these core capabilities:

  • Structured logging with multiple log levels (info, warning, error, critical)
  • Context management for adding metadata to logs
  • Automatic payload sanitization to ensure valid log entries
  • Self-hosted support via custom endpoint configuration
  • Type safety with built-in validation

Installation ​

All SDKs are currently installed directly from GitHub:

bash
# General pattern
npm install github:devatlogstyx/{sdk-name}#release

Development Note

SDKs are currently distributed via GitHub releases.

Basic Usage ​

All SDKs follow a similar initialization pattern:

javascript
const logger = useLogstyx({
  projectId: 'your_project_id',
  apiKey: 'your_api_key', // Server-side only
  endpoint: 'https://your-domain.com/api/v1/logs' // Optional: for self-hosted
});

// Send logs
logger.info({ message: 'User logged in', userId: '123' });
logger.error({ message: 'Payment failed', error: err.message });

Authentication ​

Authentication requirements differ by environment:

Server-side (Node.js, Express):

  • Requires apiKey for HMAC signature authentication
  • More secure as keys never leave your server

Client-side (Browser, React, React Native):

  • Browser/React uses origin-based authentication
  • Requires appid for React Native
  • Both need allowed Origin to be set on the project setting

Self-Hosted Configuration ​

When using a self-hosted Logstyx instance, configure the endpoint:

javascript
const logger = useLogstyx({
  projectId: 'your_project_id',
  endpoint: 'https://your-domain.com/api/v1/logs',
  // ... other options
});

Released under the MIT License.