Where API Keys Come From
CreatorCommerce API Keys
Merchants generate CC API keys in their CreatorCommerce dashboard:Shopify Admin API
For direct Shopify access to CC metaobjects, use Shopify’s standard OAuth flow or custom app credentials.Integration Auth Patterns
Pattern 1: Merchant Provides Key
Merchant copies API key from CC and pastes into your integration settings.Pattern 2: Shopify App Installation
For Shopify apps, use Shopify’s OAuth and access CC data via metaobjects.Secure Key Storage
Requirements
- Encrypt at rest — Never store API keys in plaintext
- Encrypt in transit — Always use HTTPS
- Limit access — Only services that need keys should access them
- Audit access — Log when keys are used
- Support rotation — Allow merchants to rotate keys without breaking integration
Storage Options
| Option | Use Case | Security |
|---|---|---|
| Environment variables | Single-tenant, self-hosted | Good |
| Secrets manager (AWS, GCP, Vault) | Multi-tenant SaaS | Best |
| Encrypted database column | Multi-tenant with simpler infra | Good |
| Shopify app storage | Shopify apps | Good (Shopify manages) |
Example: Encrypted Storage
Key Rotation
Support merchants rotating their API keys:- Accept new key — Provide UI for merchant to enter new key
- Validate new key — Test it works before saving
- Replace old key — Atomic swap to prevent downtime
- Log the change — Record when rotation occurred
Error Handling
Handle auth errors gracefully:| Error | Cause | Action |
|---|---|---|
401 Unauthorized | Invalid or expired key | Prompt merchant to reconnect |
403 Forbidden | Insufficient permissions | Request access verification |
429 Too Many Requests | Rate limited | Backoff and retry |