Install
The SDK is at version 0.1, a beta: it may change between 0.x releases. The source is public at github.com/Larynth-Labs/larynth-node. Report problems there.
Configure
Create an API key in the dashboard and keep it in an environment variable. Callconfigure once at startup.
listAssistants, createCall or getCallAnalysis. The names match the operationId shown on every endpoint page.
Functions take one options object with body, path, query and headers as the endpoint needs. By default they return { data, error, response }. Pass throwOnError: true to get data directly and throw on a failed request.
Example: list assistants
Example: place a call
createCall needs an Idempotency-Key so a retry cannot place the call twice. See idempotency. Use only numbers you have the right to call. Outbound calls go through the same compliance checks as a campaign.
Example: read a call summary
Example: create a webhook endpoint
Handle errors
WithoutthrowOnError, check error. It is the parsed problem response.
Verify webhooks
verifyWebhook throws a WebhookVerificationError if the signature or timestamp is wrong. signWebhook builds a signature, which is useful in tests. See verify signatures.