Skip to main content
Everything goes through one client instance.

Surfaces

  • client.portal — the portal surface: account and workspace management.
  • client.brain — the brain surface: published agent data and chat.

Credential helpers

  • client.has('portalToken' | 'workspaceKey') — was this credential supplied?
  • client.ensure('portalToken' | 'workspaceKey') — throw SyvonConfigError if not. Called automatically before each request, so a misconfigured client fails before the network, never mid-flight with a confusing 401.

Swapping credentials: .with()

.with() returns a new client with a credential swapped; the original is unchanged. The intended use is JWT refresh:

One instance, many requests

The client holds no per-request state and is safe to share. In a server app, create one per credential set and reuse it.