The most basic token provider, which simply returns the token it was instantiated with.

Generally, anywhere this can be used in the public astra-db-ts interfaces, you may also pass in a plain string or null/undefined, which is transformed into a StaticTokenProvider under the hood.

Example

const provider = new StaticTokenProvider('token');
const client = new DataAPIClient(provider);

// or just

const client = new DataAPIClient('token');

See

TokenProvider

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

#token: string | nullish

Methods