Skip to main content

Quickstart

Minimal integration examples. For the full walkthrough see Integrate the API.
npm install @auvy-synapse/client
export AUVY_API_KEY=ak_live_...
import { fromApiKey, createStream, isTokenChunk } from '@auvy-synapse/client'

const auvy = await fromApiKey()
const { receptor } = await auvy.receptors.get(auvy.workspaceSlug!, 'support-bot')
const { job_id } = await auvy.receptors.fire(receptor.id, {
  message: 'Hello from Node',
  stream: true,
})

for await (const chunk of createStream(auvy, job_id)) {
  if (isTokenChunk(chunk)) process.stdout.write(chunk.token ?? '')
}