Skip to main content
Version: 1.12.0

Function: resolveCantonJwtFromConfig()

resolveCantonJwtFromConfig(config: CantonConfig, options?: OAuthRequestOptions): Promise<string>

Defined in: canton/index.ts:205

Resolve a JWT from a CantonConfig.

Priority:

  1. config.jwt (explicit override)
  2. config.auth (OAuth2 provider — client credentials, authorization code, or static)

For clientCredentials and authorizationCode flows, clientId and clientSecret may be omitted from the auth block and will be resolved from CANTON_CLIENT_ID / CANTON_CLIENT_SECRET env vars. This keeps secrets out of config files that may be committed to version control.

Parameters

ParameterType
configCantonConfig
options?OAuthRequestOptions

Returns

Promise<string>

Throws

CCIPError (CANTON_AUTH_ERROR) when neither jwt nor auth is set.