TypeScript SDK for SupaProxy. Typed API client for building dashboards and integrations.
Alpha — API surface may change without notice.
pnpm add @supaproxy/sdk
# or
npm install @supaproxy/sdkSupaProxy uses cookie-based auth (httpOnly JWT). The SDK sends credentials: 'include' by default so cookies are attached to every request.
import { SupaProxyClient } from '@supaproxy/sdk';
const client = new SupaProxyClient('http://localhost:3001');
// Sign up (creates org, user, and first workspace)
await client.auth.signup({
org_name: 'Acme Corp',
admin_name: 'Jane',
admin_email: 'jane@acme.com',
admin_password: 'securepassword',
workspace_name: 'Support',
team_name: 'Engineering',
});
// Log in (sets session cookie)
await client.auth.login({ email: 'jane@acme.com', password: 'securepassword' });
// Check session
const { user } = await client.auth.session();For server-side usage (Node.js), pass cookies manually via headers:
const client = new SupaProxyClient({
baseUrl: 'http://localhost:3001',
headers: { Cookie: 'supaproxy_session=<jwt_token>' },
});// Workspaces
const { workspaces } = await client.workspaces.list();
const detail = await client.workspaces.detail('ws-my-workspace');
const result = await client.workspaces.query('ws-my-workspace', { query: 'Hello' });
// Conversations
const convos = await client.conversations.list('ws-my-workspace');
const convo = await client.conversations.get('ws-my-workspace', 'conv-id');
// Org settings
const org = await client.org.get();
const settings = await client.org.settings();import { SupaProxyClient, SupaProxyError } from '@supaproxy/sdk';
try {
await client.workspaces.list();
} catch (err) {
if (err instanceof SupaProxyError) {
console.error(err.status, err.message); // e.g. 401, "Not authenticated"
}
}The SDK re-exports all shared types — entities, API contracts, and config types:
import type { Workspace, Conversation, QueryResponse } from '@supaproxy/sdk';- No automatic retry or exponential backoff
- No rate limit handling (429 responses)
- No request timeout configuration
- No response caching
MIT — see LICENSE. Managed by Numstack Pty Ltd.