Skip to content

setTokenCredential

setTokenCredential(username, password, tokenExpirationMinutes?): void

Defined in: src/auth.ts:15

Stores a login for token-secured services (e.g. a utility-network feature service). Uses the recommended challenge-handler pattern: the SDK requests credentials when it actually hits a secured resource, and a TokenCredential is minted for that exact resource — so there’s no service URL to match and no need to call this before the content loads. Call once after launch.

tokenExpirationMinutes sets the lifetime of generated tokens; omit to use the server’s default.

string

string

number

void