Buckets and Environments
API keys are stored in "buckets," which organize and isolate authentication credentials across different environments. Learn more in the API Key API documentation.
Default bucket configuration
Zuplo automatically creates three buckets for each project:
- Production: Stores API keys for the production environment (your default Git branch)
- Preview: Stores API keys shared across all preview environments (non-default Git branches)
- Development: Stores API keys for the development (working copy) environment
For more information on how environments relate to Git branches, see Branch-Based Deployments.
Custom bucket configuration
To use a custom bucket, specify its bucketId in your API Key policy options:
Code
Bucket IDs start with bckt_. To find one, open
Services → API Keys → Consumers
in the Zuplo Portal, select the environment with the Dev / Preview / Prod
switcher, then click Bucket Details.
When the configuration sets no bucket, the policy uses the default bucket for the current environment.
The policy's bucketName option is deprecated. Policies that set it keep
working, but the runtime logs a warning — use bucketId instead.
Creating custom buckets
Create custom buckets using the API Key management API. See the create buckets endpoint for details.
The following example creates a bucket for a QA environment. The response
includes the new bucket's id, which is the value to set as bucketId on the
policy:
Code
Replace YOUR_ACCOUNT_NAME with your account name and YOUR_ZAPI_KEY with your
Zuplo API key.