@alertus/sdk
v0.1.0-beta.5
Published
Alertus Node.js SDK to send push notifications
Downloads
28
Readme
Alertus Node.js SDK
Lightweight TypeScript SDK for sending push notifications via Alertus API.
Install
npm install @alertus/sdkUsage
import { AlertusClient } from '@alertus/sdk';
const client = new AlertusClient({
apiKey: 'your-api-key'
});
await client.send({
title: 'Hello from Alertus!',
body: 'Your notification message',
tokens: ['device-token-1', 'device-token-2'],
data: { key: 'value' }
});Options
apiKey(required): API key string.baseUrl(optional): API base URL. Defaults tohttps://api.alertus.cloud.timeoutMs(optional): Request timeout in ms (default 10000).retries(optional): Number of retry attempts on 5xx/429/network errors (default 2).retryDelayMs(optional): Base delay between retries in ms (default 500).enableLogs(optional): Log retryable failures to console (default false).
Notes
- Retries apply to HTTP 5xx and 429 responses, and to network failures.
