Client is the authenticated handle the SDK uses to talk to the Relevance AI platform. Most applications only need one.
Initialize with createClient
createClient is the recommended way to set up the SDK. It constructs a Client, registers it as the default singleton, and returns it.
Key instance directly, which is useful when working with embed keys:
Call
createClient exactly once. It throws if a default client already exists. To work with additional projects or authentication scopes, construct Client instances directly — see Using multiple clients.The default singleton
OncecreateClient runs, the client is stored as a global default. Every SDK method that takes an optional client parameter falls back to this default when none is passed.
Using multiple clients
Some apps need to talk to multiple projects, or use different authentication scopes — for example, an API key for admin operations and an embed key for end-user interactions. In those cases, constructClient instances directly and pass them explicitly.
Only one client can be the default singleton. When using multiple clients, pass the right instance to every SDK method call.

