Dex TypeScript SDK 1.30.0
    Preparing search index...

    Interface Credential

    Supplies the current bearer token for Client and Worker calls.

    Dex asks for a token before each FlowService call and each pull stream opens. A call may overlap another call, so implementations must support concurrent requests. Throwing or rejecting fails the call locally without contacting Dex. The token travels over the same plaintext connection as other calls; protect the network path. A call deadline or cancellation ends the call even if token() remains pending.

    let currentToken = "initial-token";
    const credential: Credential = { token: () => currentToken };
    const client = new Client(registry, cache, { credential });
    currentToken = "rotated-token";
    interface Credential {
        token(): string | Promise<string>;
    }

    Implemented by

    Index

    Methods

    Methods

    • Returns the bearer token for one call or stream opening. It may run concurrently and may return a Promise. Throw or reject when no token is available.

      Returns string | Promise<string>

      The current bearer token.

      When the token cannot be supplied; the call fails before contacting Dex.