[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M792Y4N9CJW8T3VSBWCTT3R1":3,"skill-same:01M792Y4N9CJW8T3VSBWCTT3R1":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":39,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M792Y4N9CJW8T3VSBWCTT3R1","lokalise-multi-env-setup",null,"Configure Lokalise across development, staging, and production environments.\nUse when setting up multi-environment deployments, configuring per-environment secrets,\nor implementing environment-specific Lokalise configurations.\nTrigger with phrases like \"lokalise environments\", \"lokalise staging\",\n\"lokalise dev prod\", \"lokalise environment setup\", \"lokalise config by env\".","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--lokalise-pack--lokalise-multi-env-setup\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: lokalise-multi-env-setup\ndescription: |\n  Configure Lokalise across development, staging, and production environments.\n  Use when setting up multi-environment deployments, configuring per-environment secrets,\n  or implementing environment-specific Lokalise configurations.\n  Trigger with phrases like \"lokalise environments\", \"lokalise staging\",\n  \"lokalise dev prod\", \"lokalise environment setup\", \"lokalise config by env\".\nallowed-tools: Read, Write, Edit, Bash(aws:*), Bash(gcloud:*), Bash(vault:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ncompatible-with: claude-code, codex, openclaw\ntags: [saas, lokalise, deployment]\n---\n# Lokalise Multi-Environment Setup\n\n## Overview\n\nConfigure Lokalise for isolated development, staging, and production environments. Two strategies are covered: separate Lokalise projects per environment (strongest isolation) and Lokalise branching within a single project (simpler management). Both approaches include secret management, environment-aware configuration, and a promotion workflow that moves translations through the pipeline from dev to production without cross-contamination.\n\n## Prerequisites\n\n- Lokalise Team or Enterprise plan (branching requires Team plan or higher)\n- One Lokalise API token per environment, each scoped to minimum required permissions\n- Secret management system: GitHub Secrets, AWS Secrets Manager, GCP Secret Manager, or HashiCorp Vault\n- Node.js 18+ with `@lokalise\u002Fnode-api` SDK installed\n- Environment variable `NODE_ENV` (or equivalent) set in each deployment target\n\n## Instructions\n\n### Step 1: Choose Your Strategy\n\n**Option A — Separate projects per environment** (recommended for teams > 5 translators or strict compliance):\n\n| Environment | Lokalise Project | Purpose |\n|-------------|-----------------|---------|\n| Development | `MyApp (Dev)` | Rapid iteration, machine translations OK |\n| Staging | `MyApp (Staging)` | QA review, translator proofing |\n| Production | `MyApp (Prod)` | Approved translations only |\n\n**Option B — Single project with Lokalise branching** (simpler for small teams):\n\n| Branch | Purpose |\n|--------|---------|\n| `main` | Production translations |\n| `staging` | QA translations under review |\n| `dev` | Work-in-progress translations |\n\n### Step 2: Environment-Aware Configuration\n\nCreate a configuration module that selects the correct Lokalise project and credentials based on the runtime environment:\n\n```typescript\n\u002F\u002F src\u002Fconfig\u002Flokalise.ts\ninterface LokaliseEnvConfig {\n  environment: string;\n  apiToken: string;\n  projectId: string;\n  branch?: string;           \u002F\u002F Only used with Option B (branching)\n  cacheTtlMs: number;\n  enableOta: boolean;\n  fallbackLocale: string;\n  rateLimitPerSec: number;\n}\n\nconst ENV_CONFIGS: Record\u003Cstring, Omit\u003CLokaliseEnvConfig, 'apiToken' | 'projectId'>> = {\n  development: {\n    environment: 'development',\n    cacheTtlMs: 0,            \u002F\u002F No cache in dev — always fetch fresh\n    enableOta: false,\n    fallbackLocale: 'en',\n    rateLimitPerSec: 6,\n  },\n  staging: {\n    environment: 'staging',\n    cacheTtlMs: 5 * 60_000,  \u002F\u002F 5 minutes\n    enableOta: true,\n    fallbackLocale: 'en',\n    rateLimitPerSec: 6,\n  },\n  production: {\n    environment: 'production',\n    cacheTtlMs: 30 * 60_000, \u002F\u002F 30 minutes\n    enableOta: true,\n    fallbackLocale: 'en',\n    rateLimitPerSec: 4,       \u002F\u002F Conservative — leave headroom for other integrations\n  },\n};\n\nexport function getLokaliseConfig(): LokaliseEnvConfig {\n  const env = process.env.NODE_ENV || 'development';\n  const base = ENV_CONFIGS[env];\n\n  if (!base) {\n    throw new Error(`Unknown environment: ${env}. Expected: ${Object.keys(ENV_CONFIGS).join(', ')}`);\n  }\n\n  const apiToken = process.env.LOKALISE_API_TOKEN;\n  const projectId = process.env.LOKALISE_PROJECT_ID;\n\n  if (!apiToken) {\n    throw new Error('LOKALISE_API_TOKEN is not set');\n  }\n  if (!projectId) {\n    throw new Error('LOKALISE_PROJECT_ID is not set');\n  }\n\n  return {\n    ...base,\n    apiToken,\n    projectId,\n    branch: process.env.LOKALISE_BRANCH,  \u002F\u002F Optional: for branching strategy\n  };\n}\n```\n\n### Step 3: Secret Management\n\nStore API tokens securely in each environment. Never commit tokens to source control.\n\n**GitHub Actions (CI\u002FCD):**\n\n```yaml\n# .github\u002Fworkflows\u002Fdeploy.yml\njobs:\n  deploy-staging:\n    environment: staging\n    env:\n      LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN_STAGING }}\n      LOKALISE_PROJECT_ID: ${{ vars.LOKALISE_PROJECT_ID_STAGING }}\n    steps:\n      - run: npm run build\n\n  deploy-production:\n    environment: production\n    env:\n      LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN_PROD }}\n      LOKALISE_PROJECT_ID: ${{ vars.LOKALISE_PROJECT_ID_PROD }}\n    steps:\n      - run: npm run build\n```\n\n**AWS Secrets Manager:**\n\n```typescript\nimport { SecretsManagerClient, GetSecretValueCommand } from '@aws-sdk\u002Fclient-secrets-manager';\n\nasync function getLokaliseToken(environment: string): Promise\u003Cstring> {\n  const client = new SecretsManagerClient({ region: 'us-east-1' });\n  const command = new GetSecretValueCommand({\n    SecretId: `lokalise\u002F${environment}\u002Fapi-token`,\n  });\n  const response = await client.send(command);\n  return response.SecretString!;\n}\n```\n\n**GCP Secret Manager:**\n\n```typescript\nimport { SecretManagerServiceClient } from '@google-cloud\u002Fsecret-manager';\n\nasync function getLokaliseToken(environment: string): Promise\u003Cstring> {\n  const client = new SecretManagerServiceClient();\n  const [version] = await client.accessSecretVersion({\n    name: `projects\u002Fmy-project\u002Fsecrets\u002Flokalise-token-${environment}\u002Fversions\u002Flatest`,\n  });\n  return version.payload!.data!.toString();\n}\n```\n\n**HashiCorp Vault:**\n\n```bash\n# Read token from Vault\nvault kv get -field=api_token secret\u002Flokalise\u002Fproduction\n```\n\n### Step 4: Lokalise Branching (Option B Alternative)\n\nIf using a single project with branching instead of separate projects:\n\n```typescript\nimport { LokaliseApi } from '@lokalise\u002Fnode-api';\n\nconst lokalise = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN! });\nconst projectId = process.env.LOKALISE_PROJECT_ID!;\n\n\u002F\u002F Create a branch for a new environment or feature\nasync function createBranch(branchName: string): Promise\u003Cvoid> {\n  await lokalise.branches().create({ name: branchName }, { project_id: projectId });\n  console.log(`Created branch: ${branchName}`);\n}\n\n\u002F\u002F Download translations from a specific branch\nasync function downloadFromBranch(branchName: string, outputDir: string): Promise\u003Cvoid> {\n  const response = await lokalise.files().download(`${projectId}:${branchName}`, {\n    format: 'json',\n    original_filenames: true,\n    directory_prefix: '',\n    export_empty_as: 'base',\n  });\n\n  console.log(`Download URL: ${response.bundle_url}`);\n  \u002F\u002F Fetch and extract the zip from response.bundle_url into outputDir\n}\n\n\u002F\u002F Merge a branch into main after QA approval\nasync function mergeBranch(sourceBranch: string, targetBranch = 'main'): Promise\u003Cvoid> {\n  await lokalise.branches().merge(\n    { project_id: projectId },\n    {\n      source_branch_id: sourceBranch,\n      target_branch_id: targetBranch,\n      force_conflict_resolve_using: 'source',\n    }\n  );\n  console.log(`Merged ${sourceBranch} → ${targetBranch}`);\n}\n```\n\n### Step 5: Promotion Workflow (Dev to Staging to Production)\n\nPromote translations through environments with validation at each gate:\n\n```bash\n#!\u002Fbin\u002Fbash\n# scripts\u002Fpromote-translations.sh\n# Usage: .\u002Fpromote-translations.sh staging   (promote dev → staging)\n# Usage: .\u002Fpromote-translations.sh production (promote staging → production)\nset -euo pipefail\n\nTARGET_ENV=\"${1:?Usage: promote-translations.sh \u003Cstaging|production>}\"\n\ncase \"$TARGET_ENV\" in\n  staging)\n    SOURCE_TOKEN=\"$LOKALISE_API_TOKEN_DEV\"\n    SOURCE_PROJECT=\"$LOKALISE_PROJECT_ID_DEV\"\n    TARGET_TOKEN=\"$LOKALISE_API_TOKEN_STAGING\"\n    TARGET_PROJECT=\"$LOKALISE_PROJECT_ID_STAGING\"\n    ;;\n  production)\n    SOURCE_TOKEN=\"$LOKALISE_API_TOKEN_STAGING\"\n    SOURCE_PROJECT=\"$LOKALISE_PROJECT_ID_STAGING\"\n    TARGET_TOKEN=\"$LOKALISE_API_TOKEN_PROD\"\n    TARGET_PROJECT=\"$LOKALISE_PROJECT_ID_PROD\"\n    ;;\n  *)\n    echo \"Invalid target: $TARGET_ENV (expected staging or production)\"\n    exit 1\n    ;;\nesac\n\nTEMP_DIR=$(mktemp -d)\ntrap 'rm -rf \"$TEMP_DIR\"' EXIT\n\necho \"=== Step 1: Download from source ===\"\nlokalise2 file download \\\n  --token \"$SOURCE_TOKEN\" \\\n  --project-id \"$SOURCE_PROJECT\" \\\n  --format json \\\n  --original-filenames=true \\\n  --directory-prefix=\"\" \\\n  --export-empty-as=skip \\\n  --unzip-to \"$TEMP_DIR\u002F\"\n\necho \"=== Step 2: Validate completeness ===\"\nSOURCE_FILE=\"$TEMP_DIR\u002Fen.json\"\nif [[ ! -f \"$SOURCE_FILE\" ]]; then\n  echo \"ERROR: Source locale file not found\"\n  exit 1\nfi\n\nSOURCE_KEY_COUNT=$(jq '[paths(scalars)] | length' \"$SOURCE_FILE\")\necho \"Source has $SOURCE_KEY_COUNT keys\"\n\nfor locale_file in \"$TEMP_DIR\"\u002F*.json; do\n  locale=$(basename \"$locale_file\" .json)\n  key_count=$(jq '[paths(scalars)] | length' \"$locale_file\")\n  coverage=$((key_count * 100 \u002F SOURCE_KEY_COUNT))\n\n  if [[ \"$TARGET_ENV\" == \"production\" && $coverage -lt 100 ]]; then\n    echo \"BLOCKED: ${locale} is ${coverage}% translated (production requires 100%)\"\n    exit 1\n  elif [[ \"$TARGET_ENV\" == \"staging\" && $coverage -lt 80 ]]; then\n    echo \"WARNING: ${locale} is ${coverage}% translated\"\n  fi\n  echo \"  ${locale}: ${coverage}% (${key_count}\u002F${SOURCE_KEY_COUNT} keys)\"\ndone\n\necho \"=== Step 3: Upload to target ===\"\nfor locale_file in \"$TEMP_DIR\"\u002F*.json; do\n  locale=$(basename \"$locale_file\" .json)\n  lokalise2 file upload \\\n    --token \"$TARGET_TOKEN\" \\\n    --project-id \"$TARGET_PROJECT\" \\\n    --file \"$locale_file\" \\\n    --lang-iso \"$locale\" \\\n    --replace-modified \\\n    --poll \\\n    --poll-timeout 120s\n  echo \"  Uploaded ${locale}\"\n  sleep 0.2  # Stay under 6 req\u002Fsec rate limit\ndone\n\necho \"=== Promotion to ${TARGET_ENV} complete ===\"\n```\n\n## Output\n\nAfter applying this skill, the project will have:\n- Environment-aware Lokalise configuration module (`src\u002Fconfig\u002Flokalise.ts`)\n- Per-environment API tokens stored in the chosen secret manager\n- GitHub Actions workflows with environment-specific secrets\n- Promotion script for moving translations through the dev\u002Fstaging\u002Fprod pipeline\n- (If using branching) Branch management utilities for the single-project approach\n\n## Error Handling\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| `LOKALISE_API_TOKEN is not set` | Missing environment variable | Verify secret injection in deployment config |\n| Wrong translations in production | Using dev project ID | Audit `LOKALISE_PROJECT_ID` per environment; never share project IDs across environments |\n| Cross-env data leak | Shared API token with write access to multiple projects | Create separate tokens per environment with project-scoped permissions |\n| Secret rotation breaks CI | Old token in GitHub Secrets | Rotate in Lokalise first, update GitHub Secret, verify CI run |\n| Branch merge conflict | Same key edited in multiple branches | Resolve in Lokalise UI or use `force_conflict_resolve_using` |\n| Promotion blocked at 80% | Coverage gate in staging | Expected — translate remaining keys in dev before promoting |\n| Rate limit during promotion | Uploading many files sequentially | Add `sleep 0.2` between uploads; batch files if possible |\n\n## Examples\n\n### Quick Environment Check\n\n```typescript\nimport { getLokaliseConfig } from '.\u002Fconfig\u002Flokalise';\n\nconst config = getLokaliseConfig();\nconsole.log(`Environment: ${config.environment}`);\nconsole.log(`Project ID:  ${config.projectId}`);\nconsole.log(`Cache TTL:   ${config.cacheTtlMs}ms`);\nconsole.log(`OTA enabled: ${config.enableOta}`);\n\u002F\u002F Never log apiToken\n```\n\n### Startup Validation with Zod\n\n```typescript\nimport { z } from 'zod';\nimport { getLokaliseConfig } from '.\u002Fconfig\u002Flokalise';\n\nconst configSchema = z.object({\n  environment: z.enum(['development', 'staging', 'production']),\n  apiToken: z.string().min(30, 'LOKALISE_API_TOKEN looks too short — check the value'),\n  projectId: z.string().regex(\u002F^\\w+\\.\\w+$\u002F, 'LOKALISE_PROJECT_ID should be in format: projectId.branchSuffix'),\n  cacheTtlMs: z.number().min(0),\n  enableOta: z.boolean(),\n  fallbackLocale: z.string().min(2),\n  rateLimitPerSec: z.number().min(1).max(6),\n});\n\n\u002F\u002F Validate at startup — fail fast if misconfigured\nconst config = configSchema.parse(getLokaliseConfig());\n```\n\n### Environment Matrix for `.env` Files\n\n```bash\n# .env.development\nLOKALISE_API_TOKEN=dev-token-here\nLOKALISE_PROJECT_ID=123456789.dev\nLOKALISE_BRANCH=dev\n\n# .env.staging\nLOKALISE_API_TOKEN=staging-token-here\nLOKALISE_PROJECT_ID=123456789.staging\nLOKALISE_BRANCH=staging\n\n# .env.production\nLOKALISE_API_TOKEN=prod-token-here\nLOKALISE_PROJECT_ID=987654321.prod\n# No branch — production uses project root\n```\n\n> Add `.env.*` to `.gitignore`. Never commit tokens.\n\n## Resources\n\n- [Lokalise API — Projects](https:\u002F\u002Fdevelopers.lokalise.com\u002Freference\u002Flist-all-projects)\n- [Lokalise Branching](https:\u002F\u002Fdocs.lokalise.com\u002Fen\u002Farticles\u002F3181040-branching)\n- [Lokalise Team Permissions](https:\u002F\u002Fdocs.lokalise.com\u002Fen\u002Farticles\u002F1400870-team-roles-and-permissions)\n- [12-Factor App — Config](https:\u002F\u002F12factor.net\u002Fconfig)\n- [AWS Secrets Manager](https:\u002F\u002Fdocs.aws.amazon.com\u002Fsecretsmanager\u002Flatest\u002Fuserguide\u002Fintro.html)\n- [GCP Secret Manager](https:\u002F\u002Fcloud.google.com\u002Fsecret-manager\u002Fdocs)\n\n## Next Steps\n\n- Set up `lokalise-ci-integration` for automated upload\u002Fdownload in CI\n- Run `lokalise-prod-checklist` before your first production deployment\n- Use `lokalise-reference-architecture` to establish the full i18n project structure\n","# Lokalise Multi-Environment Setup\n\n## Overview\n\nConfigure Lokalise for isolated development, staging, and production environments. Two strategies are covered: separate Lokalise projects per environment (strongest isolation) and Lokalise branching within a single project (simpler management). Both approaches include secret management, environment-aware configuration, and a promotion workflow that moves translations through the pipeline from dev to production without cross-contamination.\n\n## Prerequisites\n\n- Lokalise Team or Enterprise plan (branching requires Team plan or higher)\n- One Lokalise API token per environment, each scoped to minimum required permissions\n- Secret management system: GitHub Secrets, AWS Secrets Manager, GCP Secret Manager, or HashiCorp Vault\n- Node.js 18+ with `@lokalise\u002Fnode-api` SDK installed\n- Environment variable `NODE_ENV` (or equivalent) set in each deployment target\n\n## Instructions\n\n### Step 1: Choose Your Strategy\n\n**Option A — Separate projects per environment** (recommended for teams > 5 translators or strict compliance):\n\n| Environment | Lokalise Project | Purpose |\n|-------------|-----------------|---------|\n| Development | `MyApp (Dev)` | Rapid iteration, machine translations OK |\n| Staging | `MyApp (Staging)` | QA review, translator proofing |\n| Production | `MyApp (Prod)` | Approved translations only |\n\n**Option B — Single project with Lokalise branching** (simpler for small teams):\n\n| Branch | Purpose |\n|--------|---------|\n| `main` | Production translations |\n| `staging` | QA translations under review |\n| `dev` | Work-in-progress translations |\n\n### Step 2: Environment-Aware Configuration\n\nCreate a configuration module that selects the correct Lokalise project and credentials based on the runtime environment:\n\n```typescript\n\u002F\u002F src\u002Fconfig\u002Flokalise.ts\ninterface LokaliseEnvConfig {\n  environment: string;\n  apiToken: string;\n  projectId: string;\n  branch?: string;           \u002F\u002F Only used with Option B (branching)\n  cacheTtlMs: number;\n  enableOta: boolean;\n  fallbackLocale: string;\n  rateLimitPerSec: number;\n}\n\nconst ENV_CONFIGS: Record\u003Cstring, Omit\u003CLokaliseEnvConfig, 'apiToken' | 'projectId'>> = {\n  development: {\n    environment: 'development',\n    cacheTtlMs: 0,            \u002F\u002F No cache in dev — always fetch fresh\n    enableOta: false,\n    fallbackLocale: 'en',\n    rateLimitPerSec: 6,\n  },\n  staging: {\n    environment: 'staging',\n    cacheTtlMs: 5 * 60_000,  \u002F\u002F 5 minutes\n    enableOta: true,\n    fallbackLocale: 'en',\n    rateLimitPerSec: 6,\n  },\n  production: {\n    environment: 'production',\n    cacheTtlMs: 30 * 60_000, \u002F\u002F 30 minutes\n    enableOta: true,\n    fallbackLocale: 'en',\n    rateLimitPerSec: 4,       \u002F\u002F Conservative — leave headroom for other integrations\n  },\n};\n\nexport function getLokaliseConfig(): LokaliseEnvConfig {\n  const env = process.env.NODE_ENV || 'development';\n  const base = ENV_CONFIGS[env];\n\n  if (!base) {\n    throw new Error(`Unknown environment: ${env}. Expected: ${Object.keys(ENV_CONFIGS).join(', ')}`);\n  }\n\n  const apiToken = process.env.LOKALISE_API_TOKEN;\n  const projectId = process.env.LOKALISE_PROJECT_ID;\n\n  if (!apiToken) {\n    throw new Error('LOKALISE_API_TOKEN is not set');\n  }\n  if (!projectId) {\n    throw new Error('LOKALISE_PROJECT_ID is not set');\n  }\n\n  return {\n    ...base,\n    apiToken,\n    projectId,\n    branch: process.env.LOKALISE_BRANCH,  \u002F\u002F Optional: for branching strategy\n  };\n}\n```\n\n### Step 3: Secret Management\n\nStore API tokens securely in each environment. Never commit tokens to source control.\n\n**GitHub Actions (CI\u002FCD):**\n\n```yaml\n# .github\u002Fworkflows\u002Fdeploy.yml\njobs:\n  deploy-staging:\n    environment: staging\n    env:\n      LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN_STAGING }}\n      LOKALISE_PROJECT_ID: ${{ vars.LOKALISE_PROJECT_ID_STAGING }}\n    steps:\n      - run: npm run build\n\n  deploy-production:\n    environment: production\n    env:\n      LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN_PROD }}\n      LOKALISE_PROJECT_ID: ${{ vars.LOKALISE_PROJECT_ID_PROD }}\n    steps:\n      - run: npm run build\n```\n\n**AWS Secrets Manager:**\n\n```typescript\nimport { SecretsManagerClient, GetSecretValueCommand } from '@aws-sdk\u002Fclient-secrets-manager';\n\nasync function getLokaliseToken(environment: string): Promise\u003Cstring> {\n  const client = new SecretsManagerClient({ region: 'us-east-1' });\n  const command = new GetSecretValueCommand({\n    SecretId: `lokalise\u002F${environment}\u002Fapi-token`,\n  });\n  const response = await client.send(command);\n  return response.SecretString!;\n}\n```\n\n**GCP Secret Manager:**\n\n```typescript\nimport { SecretManagerServiceClient } from '@google-cloud\u002Fsecret-manager';\n\nasync function getLokaliseToken(environment: string): Promise\u003Cstring> {\n  const client = new SecretManagerServiceClient();\n  const [version] = await client.accessSecretVersion({\n    name: `projects\u002Fmy-project\u002Fsecrets\u002Flokalise-token-${environment}\u002Fversions\u002Flatest`,\n  });\n  return version.payload!.data!.toString();\n}\n```\n\n**HashiCorp Vault:**\n\n```bash\n# Read token from Vault\nvault kv get -field=api_token secret\u002Flokalise\u002Fproduction\n```\n\n### Step 4: Lokalise Branching (Option B Alternative)\n\nIf using a single project with branching instead of separate projects:\n\n```typescript\nimport { LokaliseApi } from '@lokalise\u002Fnode-api';\n\nconst lokalise = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN! });\nconst projectId = process.env.LOKALISE_PROJECT_ID!;\n\n\u002F\u002F Create a branch for a new environment or feature\nasync function createBranch(branchName: string): Promise\u003Cvoid> {\n  await lokalise.branches().create({ name: branchName }, { project_id: projectId });\n  console.log(`Created branch: ${branchName}`);\n}\n\n\u002F\u002F Download translations from a specific branch\nasync function downloadFromBranch(branchName: string, outputDir: string): Promise\u003Cvoid> {\n  const response = await lokalise.files().download(`${projectId}:${branchName}`, {\n    format: 'json',\n    original_filenames: true,\n    directory_prefix: '',\n    export_empty_as: 'base',\n  });\n\n  console.log(`Download URL: ${response.bundle_url}`);\n  \u002F\u002F Fetch and extract the zip from response.bundle_url into outputDir\n}\n\n\u002F\u002F Merge a branch into main after QA approval\nasync function mergeBranch(sourceBranch: string, targetBranch = 'main'): Promise\u003Cvoid> {\n  await lokalise.branches().merge(\n    { project_id: projectId },\n    {\n      source_branch_id: sourceBranch,\n      target_branch_id: targetBranch,\n      force_conflict_resolve_using: 'source',\n    }\n  );\n  console.log(`Merged ${sourceBranch} → ${targetBranch}`);\n}\n```\n\n### Step 5: Promotion Workflow (Dev to Staging to Production)\n\nPromote translations through environments with validation at each gate:\n\n```bash\n#!\u002Fbin\u002Fbash\n# scripts\u002Fpromote-translations.sh\n# Usage: .\u002Fpromote-translations.sh staging   (promote dev → staging)\n# Usage: .\u002Fpromote-translations.sh production (promote staging → production)\nset -euo pipefail\n\nTARGET_ENV=\"${1:?Usage: promote-translations.sh \u003Cstaging|production>}\"\n\ncase \"$TARGET_ENV\" in\n  staging)\n    SOURCE_TOKEN=\"$LOKALISE_API_TOKEN_DEV\"\n    SOURCE_PROJECT=\"$LOKALISE_PROJECT_ID_DEV\"\n    TARGET_TOKEN=\"$LOKALISE_API_TOKEN_STAGING\"\n    TARGET_PROJECT=\"$LOKALISE_PROJECT_ID_STAGING\"\n    ;;\n  production)\n    SOURCE_TOKEN=\"$LOKALISE_API_TOKEN_STAGING\"\n    SOURCE_PROJECT=\"$LOKALISE_PROJECT_ID_STAGING\"\n    TARGET_TOKEN=\"$LOKALISE_API_TOKEN_PROD\"\n    TARGET_PROJECT=\"$LOKALISE_PROJECT_ID_PROD\"\n    ;;\n  *)\n    echo \"Invalid target: $TARGET_ENV (expected staging or production)\"\n    exit 1\n    ;;\nesac\n\nTEMP_DIR=$(mktemp -d)\ntrap 'rm -rf \"$TEMP_DIR\"' EXIT\n\necho \"=== Step 1: Download from source ===\"\nlokalise2 file download \\\n  --token \"$SOURCE_TOKEN\" \\\n  --project-id \"$SOURCE_PROJECT\" \\\n  --format json \\\n  --original-filenames=true \\\n  --directory-prefix=\"\" \\\n  --export-empty-as=skip \\\n  --unzip-to \"$TEMP_DIR\u002F\"\n\necho \"=== Step 2: Validate completeness ===\"\nSOURCE_FILE=\"$TEMP_DIR\u002Fen.json\"\nif [[ ! -f \"$SOURCE_FILE\" ]]; then\n  echo \"ERROR: Source locale file not found\"\n  exit 1\nfi\n\nSOURCE_KEY_COUNT=$(jq '[paths(scalars)] | length' \"$SOURCE_FILE\")\necho \"Source has $SOURCE_KEY_COUNT keys\"\n\nfor locale_file in \"$TEMP_DIR\"\u002F*.json; do\n  locale=$(basename \"$locale_file\" .json)\n  key_count=$(jq '[paths(scalars)] | length' \"$locale_file\")\n  coverage=$((key_count * 100 \u002F SOURCE_KEY_COUNT))\n\n  if [[ \"$TARGET_ENV\" == \"production\" && $coverage -lt 100 ]]; then\n    echo \"BLOCKED: ${locale} is ${coverage}% translated (production requires 100%)\"\n    exit 1\n  elif [[ \"$TARGET_ENV\" == \"staging\" && $coverage -lt 80 ]]; then\n    echo \"WARNING: ${locale} is ${coverage}% translated\"\n  fi\n  echo \"  ${locale}: ${coverage}% (${key_count}\u002F${SOURCE_KEY_COUNT} keys)\"\ndone\n\necho \"=== Step 3: Upload to target ===\"\nfor locale_file in \"$TEMP_DIR\"\u002F*.json; do\n  locale=$(basename \"$locale_file\" .json)\n  lokalise2 file upload \\\n    --token \"$TARGET_TOKEN\" \\\n    --project-id \"$TARGET_PROJECT\" \\\n    --file \"$locale_file\" \\\n    --lang-iso \"$locale\" \\\n    --replace-modified \\\n    --poll \\\n    --poll-timeout 120s\n  echo \"  Uploaded ${locale}\"\n  sleep 0.2  # Stay under 6 req\u002Fsec rate limit\ndone\n\necho \"=== Promotion to ${TARGET_ENV} complete ===\"\n```\n\n## Output\n\nAfter applying this skill, the project will have:\n- Environment-aware Lokalise configuration module (`src\u002Fconfig\u002Flokalise.ts`)\n- Per-environment API tokens stored in the chosen secret manager\n- GitHub Actions workflows with environment-specific secrets\n- Promotion script for moving translations through the dev\u002Fstaging\u002Fprod pipeline\n- (If using branching) Branch management utilities for the single-project approach\n\n## Error Handling\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| `LOKALISE_API_TOKEN is not set` | Missing environment variable | Verify secret injection in deployment config |\n| Wrong translations in production | Using dev project ID | Audit `LOKALISE_PROJECT_ID` per environment; never share project IDs across environments |\n| Cross-env data leak | Shared API token with write access to multiple projects | Create separate tokens per environment with project-scoped permissions |\n| Secret rotation breaks CI | Old token in GitHub Secrets | Rotate in Lokalise first, update GitHub Secret, verify CI run |\n| Branch merge conflict | Same key edited in multiple branches | Resolve in Lokalise UI or use `force_conflict_resolve_using` |\n| Promotion blocked at 80% | Coverage gate in staging | Expected — translate remaining keys in dev before promoting |\n| Rate limit during promotion | Uploading many files sequentially | Add `sleep 0.2` between uploads; batch files if possible |\n\n## Examples\n\n### Quick Environment Check\n\n```typescript\nimport { getLokaliseConfig } from '.\u002Fconfig\u002Flokalise';\n\nconst config = getLokaliseConfig();\nconsole.log(`Environment: ${config.environment}`);\nconsole.log(`Project ID:  ${config.projectId}`);\nconsole.log(`Cache TTL:   ${config.cacheTtlMs}ms`);\nconsole.log(`OTA enabled: ${config.enableOta}`);\n\u002F\u002F Never log apiToken\n```\n\n### Startup Validation with Zod\n\n```typescript\nimport { z } from 'zod';\nimport { getLokaliseConfig } from '.\u002Fconfig\u002Flokalise';\n\nconst configSchema = z.object({\n  environment: z.enum(['development', 'staging', 'production']),\n  apiToken: z.string().min(30, 'LOKALISE_API_TOKEN looks too short — check the value'),\n  projectId: z.string().regex(\u002F^\\w+\\.\\w+$\u002F, 'LOKALISE_PROJECT_ID should be in format: projectId.branchSuffix'),\n  cacheTtlMs: z.number().min(0),\n  enableOta: z.boolean(),\n  fallbackLocale: z.string().min(2),\n  rateLimitPerSec: z.number().min(1).max(6),\n});\n\n\u002F\u002F Validate at startup — fail fast if misconfigured\nconst config = configSchema.parse(getLokaliseConfig());\n```\n\n### Environment Matrix for `.env` Files\n\n```bash\n# .env.development\nLOKALISE_API_TOKEN=dev-token-here\nLOKALISE_PROJECT_ID=123456789.dev\nLOKALISE_BRANCH=dev\n\n# .env.staging\nLOKALISE_API_TOKEN=staging-token-here\nLOKALISE_PROJECT_ID=123456789.staging\nLOKALISE_BRANCH=staging\n\n# .env.production\nLOKALISE_API_TOKEN=prod-token-here\nLOKALISE_PROJECT_ID=987654321.prod\n# No branch — production uses project root\n```\n\n> Add `.env.*` to `.gitignore`. Never commit tokens.\n\n## Resources\n\n- [Lokalise API — Projects](https:\u002F\u002Fdevelopers.lokalise.com\u002Freference\u002Flist-all-projects)\n- [Lokalise Branching](https:\u002F\u002Fdocs.lokalise.com\u002Fen\u002Farticles\u002F3181040-branching)\n- [Lokalise Team Permissions](https:\u002F\u002Fdocs.lokalise.com\u002Fen\u002Farticles\u002F1400870-team-roles-and-permissions)\n- [12-Factor App — Config](https:\u002F\u002F12factor.net\u002Fconfig)\n- [AWS Secrets Manager](https:\u002F\u002Fdocs.aws.amazon.com\u002Fsecretsmanager\u002Flatest\u002Fuserguide\u002Fintro.html)\n- [GCP Secret Manager](https:\u002F\u002Fcloud.google.com\u002Fsecret-manager\u002Fdocs)\n\n## Next Steps\n\n- Set up `lokalise-ci-integration` for automated upload\u002Fdownload in CI\n- Run `lokalise-prod-checklist` before your first production deployment\n- Use `lokalise-reference-architecture` to establish the full i18n project structure\n",{"name":5,"tags":24,"author":28,"license":15,"version":29,"description":30,"allowed-tools":31,"compatible-with":32},[25,26,27],"saas","lokalise","deployment","Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Configure Lokalise across development, staging, and production environments.\nUse when setting up multi-environment deployments, configuring per-environment secrets,\nor implementing environment-specific Lokalise configurations.\nTrigger with phrases like \"lokalise environments\", \"lokalise staging\",\n\"lokalise dev prod\", \"lokalise environment setup\", \"lokalise config by env\".\n","Read, Write, Edit, Bash(aws:*), Bash(gcloud:*), Bash(vault:*)","claude-code, codex, openclaw","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fsaas-packs--lokalise-pack--lokalise-multi-env-setup",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill lokalise-multi-env-setup",{"tool":48,"command":49},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill lokalise-multi-env-setup",{"tool":51,"command":52},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill lokalise-multi-env-setup","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsaas-packs--lokalise-pack--lokalise-multi-env-setup\u002FSKILL.md",true,[],[57,64,71,78,85,93],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":89,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]