Constructor
new SupaProxyClient(options: string | ClientOptions)
Accepts a base URL string or a full options object.
// String
const client = new SupaProxyClient('http://localhost:3001');
// Options
const client = new SupaProxyClient({
baseUrl: 'http://localhost:3001',
credentials: 'include',
headers: { Cookie: 'supaproxy_session=...' }
});
Trailing slashes on the base URL are stripped automatically.
Health check
const health = await client.health();
// { status: 'ok', setup_complete: true, workspaces: 2, ai_configured: true, connections: 5 }
API groups
client.auth
| Method | Description |
|---|
login({ email, password }) | Sign in and set session cookie |
signup(request) | Create org, user, workspace in one call |
session() | Check current session |
logoutUrl() | Returns the logout URL (synchronous) |
client.org
| Method | Description |
|---|
get() | Fetch organisation details |
update(name) | Update organisation name |
settings() | List all settings (secrets masked) |
updateSetting(key, value) | Update a specific setting |
testSlack(botToken) | Test Slack bot token |
users() | List organisation users |
models() | List available LLM models |
client.workspaces
| Method | Description |
|---|
list() | List all workspaces with stats |
create({ name, team_id?, team_name?, system_prompt? }) | Create a workspace |
summary(id) | Lightweight workspace summary |
detail(id) | Full workspace with all resources |
update(id, fields) | Update workspace config |
dashboard(id) | Comprehensive dashboard metrics |
connections(id) | List connections and tools |
consumers(id) | List consumers |
knowledge(id) | List knowledge sources and gaps |
compliance(id) | List guardrails and violations |
query(id, { query, session_id? }) | Execute a query |
client.connections
| Method | Description |
|---|
delete(connectionId) | Delete a connection |
client.connectors
| Method | Description |
|---|
testMcp({ transport, url?, command?, args? }) | Test MCP connection |
addMcp({ workspace_id, name, transport, url?, command?, args? }) | Save MCP connection |
addSlackChannel({ workspace_id, channel_id, channel_name? }) | Bind Slack channel |
connectSlack({ workspace_id, bot_token, app_token, channel_id? }) | Connect Slack consumer |
The addSlackChannel and connectSlack methods are being replaced with provider-agnostic equivalents. See the consumer endpoints in the API reference for the new contract.
client.conversations
| Method | Description |
|---|
list(workspaceId, filters?, options?) | List conversations with filters |
get(workspaceId, conversationId, options?) | Get conversation with messages and stats |
close(workspaceId, conversationId) | Close a conversation |
client.queues
| Method | Description |
|---|
list() | List all background job queues |
failed(name) | List failed jobs in a queue |
retryAll(name) | Retry all failed jobs |
drain(name) | Clear all jobs from a queue |
AbortController support
Most read methods accept a RequestOptions parameter with an AbortSignal:
const controller = new AbortController();
const { workspaces } = await client.workspaces.list({ signal: controller.signal });
// Cancel the request
controller.abort();