Skip to main content

index/interfaces/SDKConfig.md

Configuration options for the SDK

Extended by​

Properties​

PropertyTypeDescription
accessToken?stringJWT access token for authenticated requests If provided, the SDK will use this token for JWT-protected endpoints without requiring login(). Token will be auto-refreshed before expiry. Alternative: Call sdk.login() to authenticate with wallet signature. Since 5.2.0
accessTokenExpiresIn?numberAccess token expiration in seconds Only used when accessToken is provided directly. Defaults to 86400 (24 hours) if not specified. Since 5.2.0
autoRefreshToken?booleanAuto-refresh JWT before expiry When enabled (default), the SDK will automatically refresh the JWT token before it expires during requests to JWT-protected endpoints. Refresh occurs when token expires within 5 minutes of request time. Default true Since 5.2.0
baseUrl?stringBase URL for the API (defaults to the prod environment)
debug?booleanWhether to enable debug logging
devBypass?booleanEnable development bypass mode (STAGE only) When enabled in STAGE environment, JWT authentication can be bypassed by appending ?bypass={address} to requests. Useful for testing. WARNING: Only works in STAGE environment. Has no effect in PROD. Default false Since 5.2.0
env?GalaChainEnvEnvironment preset (automatically configures all URLs)
events?EventsConfigEvents tracking and batching configuration Configure client-side event batching for SDK events ingestion. Events are automatically buffered and flushed in configurable batches to the backend, reducing network overhead. Since 8.2.0
headers?Record<string, string>Additional headers to include with requests
pricingConcurrency?numberConcurrency level for pricing operations on liquidity positions (default: 5)
streamAdminApiKey?stringAdmin API key for stream management operations Required for admin-only endpoints like disableStream, enableStream. Since 5.1.0
streamWebSocketUrl?stringWebSocket URL for live streaming features Defaults based on environment if not specified. Since 5.1.0
timeout?numberRequest timeout in milliseconds
userApiKey?stringPer-user API key for MultiAuthGuard endpoints If provided, the SDK will use this key for endpoints protected by MultiAuthGuard (bans, moderators, content flags) as an alternative to JWT authentication. Created via sdk.createApiKey(). Priority: userApiKey > JWT (for MultiAuthGuard endpoints only). Does NOT apply to AdminOrOverseerGuard endpoints (use streamAdminApiKey for those). Since 9.1.0