Skip to content

SDK API Reference / SDKContext

Interface: SDKContext

SDK context (resolved config + initialized logger) Passed to SDK classes and API clients

Properties

accessToken?

optional accessToken?: string

Access token for Bearer authentication (e.g., from OAuth flows) Takes precedence over apiKey when both are provided


apiKey?

optional apiKey?: string

TD API key (format: key_id/secret) Optional when used in browser with cookie-based authentication


logLevel

logLevel: LogLevel

Log level for SDK operations


profile?

optional profile?: string

TD profile name Used for profile-based usage tracking


proxy?

optional proxy?: string

HTTP proxy URL for corporate networks with SSL inspection

Resolved from (in priority order):

  1. SDKConfig.proxy (explicit)
  2. tdx.json global config
  3. HTTPS_PROXY environment variable

site

site: TDSite

TD site/region


timeout?

optional timeout?: number

Default timeout in milliseconds for HTTP requests. Applied to all API clients.