getAuthCredentials(options: __type): ModalCredentials| Name | Type | Description |
|---|---|---|
options | __type | Optional authentication configuration from ModalSandboxOptions |
// With explicit credentials
const creds = getAuthCredentials({ tokenId: "...", tokenSecret: "..." });
// Using environment variables (auto-detected)
const creds = getAuthCredentials();
// From ModalSandboxOptions
const options: ModalSandboxOptions = {
auth: { tokenId: "...", tokenSecret: "..." }
};
const creds = getAuthCredentials(options.auth);Get authentication credentials for Modal API.
Credentials are resolved in the following priority order:
options.tokenId and/or options.tokenSecret are provided,
they are used directly.MODAL_TOKEN_ID and MODAL_TOKEN_SECRET are used as fallbacks.# Go to https://modal.com/settings/tokens
# Create a new token and set the environment variables
export MODAL_TOKEN_ID=your_token_id
export MODAL_TOKEN_SECRET=your_token_secret