Note
Only one type of credential can be used at a time. If multiple credentials are provided, the last one added will take precedence.
-
API keys A unique identifier used to authenticate and authorize requests to an API.
const credentials: Credentials = { apiKey: "<YOUR_API_KEY>" };
-
Bearer tokens A temporary access token used to authenticate API requests, typically included in the Authorization header.
const credentials: Credentials = { token: "<YOUR_BEARER_TOKEN>" };
-
Service account credentials file path The file path pointing to a JSON file containing credentials for a service account, used for secure API access.
const credentials: Credentials = { path: "<YOUR_CREDENTIALS_FILE_PATH>" };
-
Service account credentials string JSON-formatted string containing service account credentials, often used as an alternative to a file for programmatic authentication.
const credentials: Credentials = { credentialsString: JSON.stringify(process.env.SKYFLOW_CREDENTIALS) };
-
Environment variables If no credentials are explicitly provided the SDK automatically looks for the SKYFLOW_CREDENTIALS environment variable. This variable must return an object like one of the examples above.