CredentialsResolver

Learn about the function that resolves the Croct credentials.

This type describes the function the SDK uses to resolve the Croct credentials for a request.

Provide one through the credentialsResolver option to serve multiple tenants from a single application, each with its own Croct application.

Definition

This type has the following shape:

type CredentialsResolver = (event: H3Event) => Promise<CroctCredentials | null> | CroctCredentials | null;

The function receives the H3 event and returns the credentials, or null to use the configured values. It may be synchronous or asynchronous.