xiaohongshu
xiaohongshu
lindy-multi-env-setup
Configure Lindy AI across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific Lindy configurations. Trigger with phrases like "lindy environments", "lindy staging", "lindy d...
Full skill instructions
Configure Lindy AI across development, staging, and production environments.
// config/lindy.ts
interface LindyConfig {
apiKey: string;
environment: 'development' | 'staging' | 'production';
baseUrl?: string;
timeout: number;
retries: number;
}
const configs: Record<string, LindyConfig> = {
development: {
apiKey: process.env.LINDY_DEV_API_KEY!,
environment: 'development',
timeout: 60000,
retries: 1,
},
staging: {
apiKey: process.env.LINDY_STAGING_API_KEY!,
environment: 'staging',
timeout: 45000,
retries: 2,
},
production: {
apiKey: process.env.LINDY_PROD_API_KEY!,
environment: 'production',
timeout: 30000,
retries: 3,
},
};
export function getLindyConfig(): LindyConfig {
const env = process.env.NODE_ENV || 'development';
return configs[env] || configs.development;
}
// lib/lindy-client.ts
import { Lindy } from '@lindy-ai/sdk';
import { getLindyConfig } from '../config/lindy';
let client: Lindy | null = null;
export function getLindyClient(): Lindy {
if (!client) {
const config = getLindyConfig();
// Validate environment
if (config.environment === 'production') {
if (!config.apiKey.startsWith('lnd_prod_')) {
throw new Error('Production requires production API key');
}
}
client = new Lindy({
apiKey: config.apiKey,
timeout: config.timeout,
retries: config.retries,
});
}
return client;
}
# AWS Secrets Manager structure
secrets/
├── lindy/development
│ └── api_key: lnd_dev_xxx
├── lindy/staging
│ └── api_key: lnd_stg_xxx
└── lindy/production
└── api_key: lnd_prod_xxx
// secrets/lindy.ts
import { SecretsManager } from '@aws-sdk/client-secrets-manager';
export async function getLindyApiKey(env: string): Promise<string> {
const client = new SecretsManager({ region: 'us-east-1' });
const response = await client.getSecretValue({
SecretId: `lindy/${env}`,
});
const secret = JSON.parse(response.SecretString!);
return secret.api_key;
}
// agents/config.ts
interface AgentMapping {
development: string;
staging: string;
production: string;
}
const agentMappings: Record<string, AgentMapping> = {
support: {
development: 'agt_dev_support',
staging: 'agt_stg_support',
production: 'agt_prod_support',
},
sales: {
development: 'agt_dev_sales',
staging: 'agt_stg_sales',
production: 'agt_prod_sales',
},
};
export function getAgentId(agentName: string): string {
const env = process.env.NODE_ENV || 'development';
const mapping = agentMappings[agentName];
if (!mapping) {
throw new Error(`Unknown agent: ${agentName}`);
}
return mapping[env as keyof AgentMapping];
}
// guards/production.ts
export function requireProduction(): void {
if (process.env.NODE_ENV !== 'production') {
throw new Error('This operation requires production environment');
}
}
export function preventProduction(): void {
if (process.env.NODE_ENV === 'production') {
throw new Error('This operation is not allowed in production');
}
}
// Usage
async function dangerousOperation() {
preventProduction();
// ... destructive test operation
}
async function productionOnlyOperation() {
requireProduction();
// ... production-only logic
}
| Issue | Cause | Solution |
|---|---|---|
| Wrong key for env | Config error | Validate key prefix |
| Secret not found | Not provisioned | Create in secrets manager |
| Agent not found | Wrong environment | Check agent mapping |
// index.ts
import { getLindyClient } from './lib/lindy-client';
import { getAgentId } from './agents/config';
async function main() {
const lindy = getLindyClient();
const agentId = getAgentId('support');
console.log(`Environment: ${process.env.NODE_ENV}`);
console.log(`Agent: ${agentId}`);
const result = await lindy.agents.run(agentId, {
input: 'Test message',
});
console.log('Response:', result.output);
}
main().catch(console.error);
Proceed to lindy-observability for monitoring setup.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience