SvelteKit

07 Deploy

Deploy SvelteKit Anvia endpoints with the right runtime constraints.

Deployment depends on your SvelteKit adapter. Verify provider clients, vector stores, and observability packages against that runtime.

1. Prefer Node For First Deploys

Use a Node-compatible adapter when you need filesystem loaders, local embeddings, provider SDKs with Node dependencies, or long-running streams.

pnpm add -D @sveltejs/adapter-node

2. Configure Environment Variables

Set secrets in your deployment platform:

OPENAI_API_KEY=sk_...
ANVIA_STUDIO_TOKEN=...
DATABASE_URL=...

Do not expose provider keys through public env prefixes.

3. Streaming Checks

Confirm your host supports unbuffered responses for application/x-ndjson. Some serverless platforms buffer responses unless streaming is explicitly enabled.

4. Production Checklist

CheckWhy
Node runtime verifiedProvider and retrieval packages may require Node APIs
Request timeout configuredAgent runs can be longer than simple CRUD requests
Secrets scoped server-sideProvider keys must never reach the browser
Error logs connectedProvider and tool failures need operational visibility

Next

Debug common failures in Troubleshooting. Add telemetry with Observability.