Skip to main content

TypeScript SDK

@auvy-synapse/client is the official public SDK for AUVY Synapse. It wraps the REST API with typed resource clients, retry logic, streaming helpers, pagination utilities, and browser/server auth support.

Install

npm install @auvy-synapse/client

Choose an auth mode

ModeBest forSetup
createAUVYClient.fromApiKey()Server-side apps and scriptsRecommended. Resolves workspace context from the API key automatically.
createAUVYClient({ apiKey, ... })Explicit server configUse when you already know the workspace slug or want manual control over baseUrl.
createAUVYClient({ publishableKey, getAccessToken })Browser appsUse a publishable key plus a user JWT.
createAUVYClient.fromEnv()Local development and infra glueReads AUVY_* and NEXT_PUBLIC_AUVY_* environment variables.
fromApiKey() performs a bootstrap call to GET /v1/session/context so the client can derive workspace_id and workspace_slug from the key.

Server quick start

import { createAUVYClient } from '@auvy-synapse/client'

const auvy = await createAUVYClient.fromApiKey(process.env.AUVY_API_KEY!)

const receptors = await auvy.receptors.list()
const { job_id } = await auvy.receptors.invoke('my-workspace', 'support-bot', {
  message: 'Summarize the latest incidents',
})

Browser quick start

import { createAUVYClient } from '@auvy-synapse/client'
import { createClient } from '@supabase/supabase-js'

const supabase = createClient(SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY)

const auvy = createAUVYClient({
  publishableKey: process.env.NEXT_PUBLIC_AUVY_PUBLISHABLE_KEY!,
  workspaceSlug: process.env.NEXT_PUBLIC_AUVY_WORKSPACE_SLUG,
  getAccessToken: async () => {
    const { data: { session } } = await supabase.auth.getSession()
    return session?.access_token ?? null
  },
})

Environment variables

The SDK supports these environment variables:
  • AUVY_API_KEY for backend API-key auth
  • AUVY_API_URL or NEXT_PUBLIC_AUVY_API_URL for self-hosted or local API URLs
  • AUVY_WORKSPACE_SLUG or NEXT_PUBLIC_AUVY_WORKSPACE_SLUG for default workspace scope
  • AUVY_PUBLISHABLE_KEY or NEXT_PUBLIC_AUVY_PUBLISHABLE_KEY for browser auth
  • AUVY_API_VERSION for explicit API version overrides
  • AUVY_TIMEOUT_MS for request timeouts

Core capabilities

  • Typed resource clients for receptors, jobs, memories, traces, pathways, neurons, reflexes, recollections, usage, activity, and more
  • createStream(...) and receptors.createStream(...) helpers for token and event streaming
  • Built-in retry and rate-limit handling
  • Async pagination utilities and listAll() helpers
  • Request/response interceptors for logging, auth refresh, and instrumentation
  • Public share-token helpers for public receptor and trace flows

Out of scope for this docs set

JWT-only workspace integration-management routes are intentionally outside this API-key-focused reference set. The public SDK docs here cover the surfaces you can drive directly with an API key, publishable key, or share token.

Next steps