apiKey configuration option. Both API tokens and OAuth access tokens are supported.
API Token
API tokens use therp_ prefix and are created in Organizations > Settings > Tokens. Pass the token directly when creating the client:
OAuth Access Token
OAuth access tokens obtained through the browser-based consent flow can also be used:Environment Variables
The SDK does not automatically read environment variables. To use an environment variable, read it explicitly:| Variable | Description |
|---|---|
ROYALTYPORT_TOKEN | API token or OAuth access token |
ROYALTYPORT_API_URL | Custom API base URL (default: https://api.royaltyport.com) |
Custom Base URL
Override the default API base URL for staging or self-hosted environments:Custom Fetch
Pass a customfetch implementation for testing, proxying, or environments without a global fetch: