/canva-pack:canva-multi-env-setupfrom canva-pack
Configures Canva Connect API across development, staging, and production environments with separate OAuth integrations, redirect URIs, and scopes per environment.
Ships in canva-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Configure Canva Connect API integrations across development, staging, and production. Each environment needs separate OAuth integrations registered in the Canva developer portal with distinct redirect URIs.
| Environment | Canva Integration | Redirect URI | Data |
|---|---|---|---|
| Development | my-app-dev | http://localhost:3000/auth/canva/callback | Test account |
| Staging | my-app-staging | https://staging.myapp.com/auth/canva/callback | Staging account |
| Production | my-app-prod | https://myapp.com/auth/canva/callback | Real users |
Important: Register a separate Canva integration per environment. Each gets its own client ID and secret.
// src/config/canva.ts
interface CanvaEnvConfig {
clientId: string;
clientSecret: string;
redirectUri: string;
baseUrl: string; // Always api.canva.com — Canva has no sandbox API
scopes: string[];
debug: boolean;
}
const configs: Record<string, CanvaEnvConfig> = {
development: {
clientId: process.env.CANVA_CLIENT_ID!,
clientSecret: process.env.CANVA_CLIENT_SECRET!,
redirectUri: 'http://localhost:3000/auth/canva/callback',
baseUrl: 'https://api.canva.com/rest/v1', // No sandbox exists
scopes: ['design:content:write', 'design:content:read', 'design:meta:read', 'asset:write', 'asset:read'],
debug: true,
},
staging: {
clientId: process.env.CANVA_CLIENT_ID!,
clientSecret: process.env.CANVA_CLIENT_SECRET!,
redirectUri: process.env.CANVA_REDIRECT_URI!,
baseUrl: 'https://api.canva.com/rest/v1',
scopes: ['design:content:write', 'design:content:read', 'design:meta:read', 'asset:write', 'asset:read'],
debug: false,
},
production: {
clientId: process.env.CANVA_CLIENT_ID!,
clientSecret: process.env.CANVA_CLIENT_SECRET!,
redirectUri: process.env.CANVA_REDIRECT_URI!,
baseUrl: 'https://api.canva.com/rest/v1',
scopes: ['design:content:write', 'design:content:read', 'design:meta:read'],
debug: false,
},
};
export function getCanvaConfig(): CanvaEnvConfig {
const env = process.env.NODE_ENV || 'development';
return configs[env] || configs.development;
}
# .env.local (git-ignored)
CANVA_CLIENT_ID=OCA_dev_xxxxxxxx
CANVA_CLIENT_SECRET=dev_xxxxxxxx
# Per-environment secrets
gh secret set CANVA_CLIENT_ID --env staging --body "OCA_staging_xxx"
gh secret set CANVA_CLIENT_SECRET --env staging --body "staging_xxx"
gh secret set CANVA_CLIENT_ID --env production --body "OCA_prod_xxx"
gh secret set CANVA_CLIENT_SECRET --env production --body "prod_xxx"
# GCP Secret Manager
gcloud secrets create canva-client-id-prod --data-file=-
gcloud secrets create canva-client-secret-prod --data-file=-
# AWS Secrets Manager
aws secretsmanager create-secret \
--name canva/production/client-id \
--secret-string "OCA_prod_xxx"
# HashiCorp Vault
vault kv put secret/canva/production \
client_id="OCA_prod_xxx" \
client_secret="prod_xxx"
// Prevent accidental cross-environment operations
function assertEnvironment(expected: string): void {
const actual = process.env.NODE_ENV || 'development';
if (actual !== expected) {
throw new Error(`Expected ${expected} environment, got ${actual}`);
}
}
// Guard destructive operations
async function deleteAllUserDesigns(userId: string, token: string) {
assertEnvironment('development'); // Block in staging/production
// ...
}
// Development: file-based for convenience
// Staging/Production: encrypted database
function getTokenStore(): TokenStore {
const env = process.env.NODE_ENV || 'development';
if (env === 'development') {
return new FileTokenStore('.canva-tokens.json'); // git-ignored
}
return new DatabaseTokenStore({
connectionString: process.env.DATABASE_URL!,
encryptionKey: process.env.TOKEN_ENCRYPTION_KEY!,
});
}
api.canva.com/rest/v1. Use separate Canva accounts for dev/staging.| Issue | Cause | Solution |
|---|---|---|
| Wrong redirect URI | Environment mismatch | Use per-environment integration |
| Missing secret | Not deployed to env | Add via secret manager |
| Token cross-contamination | Shared token store | Isolate by environment prefix |
| Production guard triggered | Wrong NODE_ENV | Set correct environment variable |
For observability setup, see canva-observability.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
30 skills in this plugin
/canva-advanced-troubleshootingApply Canva Connect API advanced debugging for hard-to-diagnose issues.
Use when standard troubleshooting fails, investigating intermittent failures,
or preparing evidence bundles for Canva developer support.
Trigger with phrases like "canva hard bug", "canva mystery error",
"canva impossible to debug", "difficult canva issue", "canva deep debug".
/canva-architecture-variantsChoose and implement Canva Connect API architecture blueprints for different scales.
Use when designing new Canva integrations, choosing between monolith/service/microservice
architectures, or planning migration paths.
Trigger with phrases like "canva architecture", "canva blueprint",
"how to structure canva", "canva project layout", "canva microservice".
/canva-ci-integrationConfigure CI/CD pipelines for Canva Connect API integrations with GitHub Actions.
Use when setting up automated testing, configuring CI pipelines,
or integrating Canva API tests into your build process.
Trigger with phrases like "canva CI", "canva GitHub Actions",
"canva automated tests", "CI canva", "canva pipeline".
/canva-common-errorsDiagnose and fix Canva Connect API errors and HTTP status codes.
Use when encountering Canva errors, debugging failed requests,
or troubleshooting integration issues.
Trigger with phrases like "canva error", "fix canva",
"canva not working", "debug canva", "canva 401", "canva 429".
/canva-core-workflow-aExecute the Canva design creation and export pipeline via the Connect API.
Use when building design creation workflows, exporting designs programmatically,
or integrating Canva's design tools into your application.
Trigger with phrases like "canva create design", "canva export",
"canva design pipeline", "canva generate content".
/canva-core-workflow-bExecute Canva asset management, brand template autofill, and folder organization.
Use when uploading assets, autofilling brand templates with dynamic data,
or organizing designs into folders via the Connect API.
Trigger with phrases like "canva assets", "canva brand template",
"canva autofill", "canva folders", "canva upload image".
npx claudepluginhub flight505/skill-forge --plugin canva-packOther plugins' skills for the same job