@raclip/sdk
v0.0.4
Published
Official Node.js SDK for the raclip platform.
Downloads
139
Readme
@raclip/sdk
Official Node.js SDK for the raclip device management and call recording platform.
Install
npm install @raclip/sdk
pnpm add @raclip/sdk
yarn add @raclip/sdk
bun add @raclip/sdkQuick start
import { Client } from '@raclip/sdk'
const client = new Client({ apiKey: 'raclip_prod_...' })
const devices = await client.devices.list()
const calls = await client.calls.list(devices.devices[0].device_id)
const latest = await client.calls.latest(devices.devices[0].device_id)
await client.calls.download(devices.devices[0].device_id, latest.call_id, 'recording.mp3')Auth
Pass your API key explicitly or set the RACLIP_API_KEY environment variable:
// Option 1 — explicit
const client = new Client({ apiKey: 'raclip_prod_...' })
// Option 2 — env var (RACLIP_API_KEY)
const client = new Client()Error handling
import { Client, NotFoundError, AuthenticationError, RateLimitError } from '@raclip/sdk'
try {
const call = await client.calls.get(deviceId, callId)
} catch (err) {
if (err instanceof NotFoundError) console.error('not found')
else if (err instanceof AuthenticationError) console.error('bad API key')
else if (err instanceof RateLimitError) console.error('retry after', err.retryAfter, 's')
else throw err
}All errors extend RaclipError and expose statusCode and responseBody.
API reference
| Resource | Method | Description |
|----------|--------|-------------|
| devices | list(params?) | Paginated device list |
| devices | stats() | Org-wide device summary |
| devices | get(deviceId) | Single device |
| devices | status(deviceId) | Current device status snapshot |
| calls | list(deviceId, params?) | Paginated call list |
| calls | latest(deviceId, params?) | Most recent call |
| calls | get(deviceId, callId, params?) | Single call |
| calls | info(deviceId, callId) | Call metadata without download URL |
| calls | statistics(deviceId, params?) | Aggregate call stats |
| calls | download(deviceId, callId, dest) | Stream MP3 to file path or Writable |
Requirements
Node.js ≥ 18. No runtime dependencies.
License
MIT
