https://github.com/ghalex/logzai-otlp-js
Official JavaScript/TypeScript client for LogzAI — send logs to the LogzAI platform using the OpenTelemetry Protocol (OTLP).
https://github.com/ghalex/logzai-otlp-js
logging logs
Last synced: 9 months ago
JSON representation
Official JavaScript/TypeScript client for LogzAI — send logs to the LogzAI platform using the OpenTelemetry Protocol (OTLP).
- Host: GitHub
- URL: https://github.com/ghalex/logzai-otlp-js
- Owner: ghalex
- Created: 2025-09-26T14:03:50.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-26T14:06:28.000Z (9 months ago)
- Last Synced: 2025-09-26T16:09:41.171Z (9 months ago)
- Topics: logging, logs
- Language: TypeScript
- Homepage: https://logzai.com
- Size: 20.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LogzAI OTL
Official JavaScript/TypeScript client for LogzAI — send logs to the LogzAI platform using the OpenTelemetry Protocol (OTLP).
## Installation
```bash
npm install logzai-otl
```
## Usage
### Node.js Example
```typescript
import logzai from 'logzai-otl';
// Initialize LogzAI
logzai.init({
ingestToken: 'your-ingest-token',
ingestEndpoint: 'https://ingest.logzai.com',
serviceName: 'my-node-app',
environment: 'production'
});
// Send logs
logzai.info('Application started', { version: '1.0.0' });
logzai.error('Something went wrong', { error: 'details' });
// Cleanup
await logzai.shutdown();
```
### Browser Example
```html
import logzai from 'logzai-otl/browser';
// Initialize LogzAI
logzai.init({
ingestToken: 'your-ingest-token',
ingestEndpoint: 'https://ingest.logzai.com',
serviceName: 'my-web-app',
environment: 'production'
});
// Send logs
logzai.info('User action', { userId: '123', action: 'click' });
```
## Development
```bash
# Install dependencies
npm install
# Build the library
npm run build
# Run in development mode
npm run dev
```
## Building
The library is built using Vite and outputs multiple formats:
- ES modules (`dist/logzai-otl.es.js`)
- CommonJS (`dist/logzai-otl.cjs.js`)
- UMD (`dist/logzai-otl.umd.js`)
- TypeScript declarations (`dist/index.d.ts`)
## Publishing
```bash
npm publish
```
## License
MIT