Node SDK
npm install @glytos/nodeSetup
import { Glytos } from '@glytos/node';
const glytos = new Glytos({ apiKey: process.env.GLYTOS_API_KEY! });Resources
The client exposes the API by resource:
await glytos.workflows.list();
await glytos.workflows.retrieve(uuid);
await glytos.workflows.create({ name: 'Receptionist', mode: 'prompt' });
await glytos.workflows.publish(uuid);
await glytos.calls.create({ transport: 'phone', workflow_uuid: uuid, to_number: '+1...' });
await glytos.calls.list();
await glytos.sessions.retrieve(workflowUuid, sessionUuid);Anything not wrapped
The SDK is thin on purpose. Anything it does not wrap is still reachable, with auth and error handling applied:
await glytos.request('GET', '/providers');Verifying webhooks
import { verifyWebhook } from '@glytos/node';
// `rawBody` must be the untouched request body - parsing and re-serialising it
// changes the bytes and the signature will not match.
const ok = verifyWebhook(rawBody, request.headers['x-glytos-signature'], secret);It is also on the client as glytos.webhooks.verify(...). See
Webhooks.