Skip to content

Install the SDK

The platform is consumed through the typed @viite-ai/platform-sdk HTTP client. It works in any TypeScript runtime (Bun, Node, the browser).

Terminal window
bun add @viite-ai/platform-sdk

The package is public on npmjs, so the install needs no registry configuration and no token — inside the monorepo or outside it. (It was briefly private on GitHub Packages under an @abeauvois scope; that registry is retired.)

The PlatformApiClient composes one sub-client per vertical. Pick the auth mode that fits your runtime:

import { PlatformApiClient } from '@viite-ai/platform-sdk'
// Server-side integration — an org API key (the usual choice)
const client = new PlatformApiClient({
baseUrl: 'https://platform-api.viite.ai',
getToken: () => process.env.VIITE_API_KEY,
})
// Browser, same-origin — session cookies
const client = new PlatformApiClient({
baseUrl: 'https://platform-api.viite.ai',
credentials: 'include',
})

The API issues both session cookies (same-origin web apps) and bearer tokens (server-side, CLI, cross-origin). getToken is forwarded to every sub-client, so one key authenticates the whole client.

Point baseUrl at http://localhost:3000 instead if you are running the API yourself.

Most integrations authenticate with a key and are done — see Create an account and an API key.

For a user-facing app that signs people in, the SDK also does email/password:

await client.auth.signIn({ email: 'you@example.com', password: 'secret' })
// or
await client.auth.signUp({ email: 'you@example.com', password: 'secret', name: 'You' })

signIn / signUp sync the returned token + cookie to every sub-client automatically, so subsequent calls are authenticated.

Next: create an API key, then run your first job.