Perplexity Multi-Environment Setup

VerifiedCaution

Configure Perplexity across development, staging, and production environments. Manage secrets, environment detection, and per-environment configuration.

Sby Skills Guide Bot
DevOpsIntermediate
8/29/2026
Claude CodeCursorWindsurfCodex
#perplexity#multi-environment#secrets-management#configuration#ci-cd

Recommended for

Automated summary

This skill describes how to configure the Perplexity API separately for development, staging, and production environments, using per-environment config files and matching secret management.

Strengths

  • Provides a clear config/perplexity file layout with a base.json plus per-environment overrides
  • Covers secret handling for local .env files, GitHub Actions CI, AWS Secrets Manager, GCP Secret Manager, and Vault
  • Includes TypeScript environment detection and a guard that blocks dangerous operations outside production

Limitations

  • The sandbox and staging URLs shown (api-sandbox/api-staging.perplexity.com) are unverified and should be checked against Perplexity's docs
  • The content is cut off at the feature flags section, so that part is not usable as provided
  • Heavily Node/TypeScript-oriented and does not address key rotation or the full deployment pipeline
When to use it

Use it when you need to isolate Perplexity keys and configuration across development, staging, and production in a Node/TypeScript application.

When not to use it

Avoid it if you need a complete, language-agnostic guide to deploying Perplexity, or if the sandbox/staging endpoints must be guaranteed accurate.

Security analysis

Caution
Quality score80/100

The skill uses powerful cloud and secret management CLI tools for legitimate configuration purposes. The commands are read-only secret retrieval and do not involve destructive actions, exfiltration, or obfuscation. However, secret retrieval via bash carries inherent risk of accidental exposure, so caution is warranted.

Findings
  • •Uses Bash commands (aws, gcloud, vault) to retrieve secrets; if output is logged or not handled carefully, secrets could be exposed.
  • •Includes example of a dangerous operation (deleteAllData) but it is guarded and not executed by the skill.
How this analysis is made

Examples

Set up three environments
Set up Perplexity configuration for development, staging, and production using a base.json with per-environment overrides, and tell me which env vars I need.
Wire secrets into CI
Show me how to pass the right Perplexity API key per environment in a GitHub Actions matrix build using repository secrets.
Block prod-only operations
Add an environment guard so destructive Perplexity operations can only run when NODE_ENV is production.

name: perplexity-multi-env-setup description: | Configure Perplexity across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific Perplexity configurations. Trigger with phrases like "perplexity environments", "perplexity staging", "perplexity dev prod", "perplexity environment setup", "perplexity config by env". allowed-tools: Read, Write, Edit, Bash(aws:), Bash(gcloud:), Bash(vault:*) version: 1.0.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io

Perplexity Multi-Environment Setup

Overview

Configure Perplexity across development, staging, and production environments.

Prerequisites

  • Separate Perplexity accounts or API keys per environment
  • Secret management solution (Vault, AWS Secrets Manager, etc.)
  • CI/CD pipeline with environment variables
  • Environment detection in application

Environment Strategy

| Environment | Purpose | API Keys | Data | |-------------|---------|----------|------| | Development | Local dev | Test keys | Sandbox | | Staging | Pre-prod validation | Staging keys | Test data | | Production | Live traffic | Production keys | Real data |

Configuration Structure

config/
├── perplexity/
│   ├── base.json           # Shared config
│   ├── development.json    # Dev overrides
│   ├── staging.json        # Staging overrides
│   └── production.json     # Prod overrides

base.json

{
  "timeout": 30000,
  "retries": 3,
  "cache": {
    "enabled": true,
    "ttlSeconds": 60
  }
}

development.json

{
  "apiKey": "${PERPLEXITY_API_KEY}",
  "baseUrl": "https://api-sandbox.perplexity.com",
  "debug": true,
  "cache": {
    "enabled": false
  }
}

staging.json

{
  "apiKey": "${PERPLEXITY_API_KEY_STAGING}",
  "baseUrl": "https://api-staging.perplexity.com",
  "debug": false
}

production.json

{
  "apiKey": "${PERPLEXITY_API_KEY_PROD}",
  "baseUrl": "https://api.perplexity.com",
  "debug": false,
  "retries": 5
}

Environment Detection

// src/perplexity/config.ts
import baseConfig from '../../config/perplexity/base.json';

type Environment = 'development' | 'staging' | 'production';

function detectEnvironment(): Environment {
  const env = process.env.NODE_ENV || 'development';
  const validEnvs: Environment[] = ['development', 'staging', 'production'];
  return validEnvs.includes(env as Environment)
    ? (env as Environment)
    : 'development';
}

export function getPerplexityConfig() {
  const env = detectEnvironment();
  const envConfig = require(`../../config/perplexity/${env}.json`);

  return {
    ...baseConfig,
    ...envConfig,
    environment: env,
  };
}

Secret Management by Environment

Local Development

# .env.local (git-ignored)
PERPLEXITY_API_KEY=sk_test_dev_***

CI/CD (GitHub Actions)

env:
  PERPLEXITY_API_KEY: ${{ secrets.PERPLEXITY_API_KEY_${{ matrix.environment }} }}

Production (Vault/Secrets Manager)

# AWS Secrets Manager
aws secretsmanager get-secret-value --secret-id perplexity/production/api-key

# GCP Secret Manager
gcloud secrets versions access latest --secret=perplexity-api-key

# HashiCorp Vault
vault kv get -field=api_key secret/perplexity/production

Environment Isolation

// Prevent production operations in non-prod
function guardProductionOperation(operation: string): void {
  const config = getPerplexityConfig();

  if (config.environment !== 'production') {
    console.warn(`[perplexity] ${operation} blocked in ${config.environment}`);
    throw new Error(`${operation} only allowed in production`);
  }
}

// Usage
async function deleteAllData() {
  guardProductionOperation('deleteAllData');
  // Dangerous operation here
}

Feature Flags by Environment

const featureFlags: Record<Environment, Record<string, boolean>> = {
  development: {
    newFeature: true,
    betaApi: true,
  },
  staging: {
    newFeature: true,
    betaApi: false,
  },
  production: {
    newFeature: false,
    betaApi: false,
  },
};

Instructions

Step 1: Create Config Structure

Set up the base and per-environment configuration files.

Step 2: Implement Environment Detection

Add logic to detect and load environment-specific config.

Step 3: Configure Secrets

Store API keys securely using your secret management solution.

Step 4: Add Environment Guards

Implement safeguards for production-only operations.

Output

  • Multi-environment config structure
  • Environment detection logic
  • Secure secret management
  • Production safeguards enabled

Error Handling

| Issue | Cause | Solution | |-------|-------|----------| | Wrong environment | Missing NODE_ENV | Set environment variable | | Secret not found | Wrong secret path | Verify secret manager config | | Config merge fails | Invalid JSON | Validate config files | | Production guard triggered | Wrong environment | Check NODE_ENV value |

Examples

Quick Environment Check

const env = getPerplexityConfig();
console.log(`Running in ${env.environment} with ${env.baseUrl}`);

Resources

Next Steps

For observability setup, see perplexity-observability.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/perplexity-multi-environment-setup-mte1lil1' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/perplexity-multi-environment-setup-mte1lil1/download' --output '.skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md.part' && mv '.skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md.part' '.skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Write, Edit, Bash(aws:*), Bash(gcloud:*), Bash(vault:*)

Original excerpt: Prerequisites
  • Separate Perplexity accounts or API keys per environment
  • Secret management solution (Vault, AWS Secrets Manager, etc.)
  • CI/CD pipeline with environment variables
  • Environment detection in application

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md' && test -s '.skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/perplexity-multi-env-setup' && cp -R '.skill-downloads/perplexity-multi-environment-setup-mte1lil1' '.claude/skills/perplexity-multi-env-setup'

Cursor
test -f '.skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md' && test -s '.skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/perplexity-multi-env-setup' && cp -R '.skill-downloads/perplexity-multi-environment-setup-mte1lil1' '.cursor/skills/perplexity-multi-env-setup'

Codex
test -f '.skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md' && test -s '.skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/perplexity-multi-env-setup' && cp -R '.skill-downloads/perplexity-multi-environment-setup-mte1lil1' '.agents/skills/perplexity-multi-env-setup'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/perplexity-multi-environment-setup-mte1lil1'

openskills read 'perplexity-multi-environment-setup-mte1lil1'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/perplexity-multi-environment-setup-mte1lil1/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills