OptionalapiThe application ID string. Must be unique, multiple connections with the same ID will be rejected.
Optional ExperimentalauthAuthentication type to use. Can be 'token', 'cookie', or 'apiKey'. If not provided, 'token'
will be used. When apiKey is provided in the config, this is automatically set to 'apiKey'.
token authentication relies on a token stored in the client instance. This is what 3rd party
Node.js apps should use.
cookie authentication relies on htmlOnly cookie, set by the server. This will only work for
browser apps located on .sogni.ai subdomains due to CORS restrictions.
apiKey authentication uses a pre-generated API key.
OptionalloggerLogger to use. If not provided, a default console logger will be used
OptionallogLog level to use. This option is ignored if a logger is provided
Optional ExperimentalmultiBrowser only. If true, the client will use a single WebSocket connection shared across multiple tabs. This is useful for browser apps that need to process multiple projects at the same time. Only works in browser environment and with cookie authentication.
OptionalnetworkWhich network to use after logging in. Can be 'fast' or 'relaxed'
OptionaltestnetIf true, the client will connect to the testnet. Ignored if jsonRpcUrl is provided
API key for authentication. When provided, the client will use API key authentication instead of username/password login. API keys support both socket-based operations (image generation, LLM chat) and most REST API calls (balance, profile, etc.). Sensitive account operations (withdrawals, staking, 2FA) are not available with API key auth.