Claude Code skill pack for Lucidchart (18 skills)
Installation
Open Claude Code and run this command:
/plugin install lucidchart-pack@claude-code-plugins-plus
Use --global to install for all projects, or --project for current project only.
Skills (18)
Configure Lucidchart CI/CD integration with GitHub Actions and testing.
Lucidchart CI Integration
Overview
Set up CI/CD pipelines for Lucidchart integrations with automated testing.
Prerequisites
- GitHub repository with Actions enabled
- Lucidchart test API key
- npm/pnpm project configured
Instructions
Step 1: Create GitHub Actions Workflow
Create .github/workflows/lucidchart-integration.yml:
name: Lucidchart Integration Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
LUCIDCHART_API_KEY: ${{ secrets.LUCIDCHART_API_KEY }}
jobs:
test:
runs-on: ubuntu-latest
env:
LUCIDCHART_API_KEY: ${{ secrets.LUCIDCHART_API_KEY }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm test -- --coverage
- run: npm run test:integration
Step 2: Configure Secrets
gh secret set LUCIDCHART_API_KEY --body "sk_test_***"
Step 3: Add Integration Tests
describe('Lucidchart Integration', () => {
it.skipIf(!process.env.LUCIDCHART_API_KEY)('should connect', async () => {
const client = getLucidchartClient();
const result = await client.healthCheck();
expect(result.status).toBe('ok');
});
});
Output
- Automated test pipeline
- PR checks configured
- Coverage reports uploaded
- Release workflow ready
Error Handling
| Issue | Cause | Solution |
|---|---|---|
| Secret not found | Missing configuration | Add secret via gh secret set |
| Tests timeout | Network issues | Increase timeout or mock |
| Auth failures | Invalid key | Check secret value |
Examples
Release Workflow
on:
push:
tags: ['v*']
jobs:
release:
runs-on: ubuntu-latest
env:
LUCIDCHART_API_KEY: ${{ secrets.LUCIDCHART_API_KEY_PROD }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- name: Verify Lucidchart production readiness
run: npm run test:integration
- run: npm run build
- run: npm publish
Branch Protection
required_status_checks:
- "test"
- "lucidchart-integration"
Resources
Next St
Diagnose and fix Lucidchart common errors and exceptions.
Lucidchart Common Errors
Overview
Quick reference for the top 10 most common Lucidchart errors and their solutions.
Prerequisites
- Lucidchart SDK installed
- API credentials configured
- Access to error logs
Instructions
Step 1: Identify the Error
Check error message and code in your logs or console.
Step 2: Find Matching Error Below
Match your error to one of the documented cases.
Step 3: Apply Solution
Follow the solution steps for your specific error.
Output
- Identified error cause
- Applied fix
- Verified resolution
Error Handling
Authentication Failed
Error Message:
Authentication error: Invalid API key
Cause: API key is missing, expired, or invalid.
Solution:
# Verify API key is set
echo $LUCIDCHART_API_KEY
Rate Limit Exceeded
Error Message:
Rate limit exceeded. Please retry after X seconds.
Cause: Too many requests in a short period.
Solution:
Implement exponential backoff. See lucidchart-rate-limits skill.
Network Timeout
Error Message:
Request timeout after 30000ms
Cause: Network connectivity or server latency issues.
Solution:
// Increase timeout
const client = new Client({ timeout: 60000 });
Examples
Quick Diagnostic Commands
# Check Lucidchart status
curl -s https://status.lucidchart.com
# Verify API connectivity
curl -I https://api.lucidchart.com
# Check local configuration
env | grep LUCIDCHART
Escalation Path
- Collect evidence with
lucidchart-debug-bundle - Check Lucidchart status page
- Contact support with request ID
Resources
Next Steps
For comprehensive debugging, see lucidchart-debug-bundle.
Execute Lucidchart primary workflow: Core Workflow A.
Lucidchart Core Workflow A
Overview
Primary money-path workflow for Lucidchart. This is the most common use case.
Prerequisites
- Completed
lucidchart-install-authsetup - Understanding of Lucidchart core concepts
- Valid API credentials configured
Instructions
Step 1: Initialize
// Step 1 implementation
Step 2: Execute
// Step 2 implementation
Step 3: Finalize
// Step 3 implementation
Output
- Completed Core Workflow A execution
- Expected results from Lucidchart API
- Success confirmation or error details
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Error 1 | Cause | Solution |
| Error 2 | Cause | Solution |
Examples
Complete Workflow
// Complete workflow example
Common Variations
- Variation 1: Description
- Variation 2: Description
Resources
Next Steps
For secondary workflow, see lucidchart-core-workflow-b.
Execute Lucidchart secondary workflow: Core Workflow B.
Lucidchart Core Workflow B
Overview
Secondary workflow for Lucidchart. Complements the primary workflow.
Prerequisites
- Completed
lucidchart-install-authsetup - Familiarity with
lucidchart-core-workflow-a - Valid API credentials configured
Instructions
Step 1: Setup
// Step 1 implementation
Step 2: Process
// Step 2 implementation
Step 3: Complete
// Step 3 implementation
Output
- Completed Core Workflow B execution
- Results from Lucidchart API
- Success confirmation or error details
Error Handling
| Aspect | Workflow A | Workflow B |
|---|---|---|
| Use Case | Primary | Secondary |
| Complexity | Medium | Lower |
| Performance | Standard | Optimized |
Examples
Complete Workflow
// Complete workflow example
Error Recovery
// Error handling code
Resources
Next Steps
For common errors, see lucidchart-common-errors.
Optimize Lucidchart costs through tier selection, sampling, and usage monitoring.
Lucidchart Cost Tuning
Overview
Optimize Lucidchart costs through smart tier selection, sampling, and usage monitoring.
Prerequisites
- Access to Lucidchart billing dashboard
- Understanding of current usage patterns
- Database for usage tracking (optional)
- Alerting system configured (optional)
Pricing Tiers
| Tier | Monthly Cost | Included | Overage |
|---|---|---|---|
| Free | $0 | 1,000 requests | N/A |
| Pro | $99 | 100,000 requests | $0.001/request |
| Enterprise | Custom | Unlimited | Volume discounts |
Cost Estimation
interface UsageEstimate {
requestsPerMonth: number;
tier: string;
estimatedCost: number;
recommendation?: string;
}
function estimateLucidchartCost(requestsPerMonth: number): UsageEstimate {
if (requestsPerMonth <= 1000) {
return { requestsPerMonth, tier: 'Free', estimatedCost: 0 };
}
if (requestsPerMonth <= 100000) {
return { requestsPerMonth, tier: 'Pro', estimatedCost: 99 };
}
const proOverage = (requestsPerMonth - 100000) * 0.001;
const proCost = 99 + proOverage;
return {
requestsPerMonth,
tier: 'Pro (with overage)',
estimatedCost: proCost,
recommendation: proCost > 500
? 'Consider Enterprise tier for volume discounts'
: undefined,
};
}
Usage Monitoring
class LucidchartUsageMonitor {
private requestCount = 0;
private bytesTransferred = 0;
private alertThreshold: number;
constructor(monthlyBudget: number) {
this.alertThreshold = monthlyBudget * 0.8; // 80% warning
}
track(request: { bytes: number }) {
this.requestCount++;
this.bytesTransferred += request.bytes;
if (this.estimatedCost() > this.alertThreshold) {
this.sendAlert('Approaching Lucidchart budget limit');
}
}
estimatedCost(): number {
return estimateLucidchartCost(this.requestCount).estimatedCost;
}
private sendAlert(message: string) {
// Send to Slack, email, PagerDuty, etc.
}
}
Cost Reduction Strategies
Step 1: Request Sampling
function shouldSample(samplingRate = 0.1): boolean {
return Math.random() < samplingRate;
}
// Use for non-critical telemetry
if (shouldSample(0.1)) { // 10% sample
await lucidchartClient.trackEvent(event);
}
Step 2: Batching Requests
// Instead of N individual calls
await Promise.all(ids.map(id => lucidchartClient.get(id)));
// Use batch endpoint (1 call)
await lucidchartClient.batchGet(ids);
Step 3: Caching (from P16)
- Cache frequently accesse
Collect Lucidchart debug evidence for support tickets and troubleshooting.
Lucidchart Debug Bundle
Overview
Collect all necessary diagnostic information for Lucidchart support tickets.
Prerequisites
- Lucidchart SDK installed
- Access to application logs
- Permission to collect environment info
Instructions
Step 1: Create Debug Bundle Script
#!/bin/bash
# lucidchart-debug-bundle.sh
BUNDLE_DIR="lucidchart-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"
echo "=== Lucidchart Debug Bundle ===" > "$BUNDLE_DIR/summary.txt"
echo "Generated: $(date)" >> "$BUNDLE_DIR/summary.txt"
Step 2: Collect Environment Info
# Environment info
echo "--- Environment ---" >> "$BUNDLE_DIR/summary.txt"
node --version >> "$BUNDLE_DIR/summary.txt" 2>&1
npm --version >> "$BUNDLE_DIR/summary.txt" 2>&1
echo "LUCIDCHART_API_KEY: ${LUCIDCHART_API_KEY:+[SET]}" >> "$BUNDLE_DIR/summary.txt"
Step 3: Gather SDK and Logs
# SDK version
npm list @lucidchart/sdk 2>/dev/null >> "$BUNDLE_DIR/summary.txt"
# Recent logs (redacted)
grep -i "lucidchart" ~/.npm/_logs/*.log 2>/dev/null | tail -50 >> "$BUNDLE_DIR/logs.txt"
# Configuration (redacted - secrets masked)
echo "--- Config (redacted) ---" >> "$BUNDLE_DIR/summary.txt"
cat .env 2>/dev/null | sed 's/=.*/=***REDACTED***/' >> "$BUNDLE_DIR/config-redacted.txt"
# Network connectivity test
echo "--- Network Test ---" >> "$BUNDLE_DIR/summary.txt"
echo -n "API Health: " >> "$BUNDLE_DIR/summary.txt"
curl -s -o /dev/null -w "%{http_code}" https://api.lucidchart.com/health >> "$BUNDLE_DIR/summary.txt"
echo "" >> "$BUNDLE_DIR/summary.txt"
Step 4: Package Bundle
tar -czf "$BUNDLE_DIR.tar.gz" "$BUNDLE_DIR"
echo "Bundle created: $BUNDLE_DIR.tar.gz"
Output
lucidchart-debug-YYYYMMDD-HHMMSS.tar.gzarchive containing:summary.txt- Environment and SDK infologs.txt- Recent redacted logsconfig-redacted.txt- Configuration (secrets removed)
Error Handling
| Item | Purpose | Included | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Environment versions | Compatibility check | ✓ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SDK version | Version-specific bugs | ✓ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Error logs (redacted) | Root cause analysis | ✓ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Config (redacted) | Configuration issues |
| Error | Cause | Solution |
|---|---|---|
| Import Error | SDK not installed | Verify with npm list or pip show |
| Auth Error | Invalid credentials | Check environment variable is set |
| Timeout | Network issues | Increase timeout or check connectivity |
| Rate Limit | Too many requests | Wait and retry with exponential backoff |
Examples
TypeScript Example
import { LucidchartClient } from '@lucidchart/sdk';
const client = new LucidchartClient({
apiKey: process.env.LUCIDCHART_API_KEY,
});
async function main() {
// Your first API call here
}
main().catch(console.error);
Python Example
from lucidchart import LucidchartClient
client = LucidchartClient()
# Your first API call here
Resources
Next Steps
Proceed to lucidchart-local-dev-loop for development workflow setup.
Install and configure Lucidchart SDK/CLI authentication.
Lucidchart Install & Auth
Overview
Set up Lucidchart SDK/CLI and configure authentication credentials.
Prerequisites
- Node.js 18+ or Python 3.10+
- Package manager (npm, pnpm, or pip)
- Lucidchart account with API access
- API key from Lucidchart dashboard
Instructions
Step 1: Install SDK
# Node.js
npm install @lucidchart/sdk
# Python
pip install lucidchart
Step 2: Configure Authentication
# Set environment variable
export LUCIDCHART_API_KEY="your-api-key"
# Or create .env file
echo 'LUCIDCHART_API_KEY=your-api-key' >> .env
Step 3: Verify Connection
// Test connection code here
Output
- Installed SDK package in node_modules or site-packages
- Environment variable or .env file with API key
- Successful connection verification output
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Invalid API Key | Incorrect or expired key | Verify key in Lucidchart dashboard |
| Rate Limited | Exceeded quota | Check quota at https://docs.lucidchart.com |
| Network Error | Firewall blocking | Ensure outbound HTTPS allowed |
| Module Not Found | Installation failed | Run npm install or pip install again |
Examples
TypeScript Setup
import { LucidchartClient } from '@lucidchart/sdk';
const client = new LucidchartClient({
apiKey: process.env.LUCIDCHART_API_KEY,
});
Python Setup
from lucidchart import LucidchartClient
client = LucidchartClient(
api_key=os.environ.get('LUCIDCHART_API_KEY')
)
Resources
Next Steps
After successful auth, proceed to lucidchart-hello-world for your first API call.
Configure Lucidchart local development with hot reload and testing.
Lucidchart Local Dev Loop
Overview
Set up a fast, reproducible local development workflow for Lucidchart.
Prerequisites
- Completed
lucidchart-install-authsetup - Node.js 18+ with npm/pnpm
- Code editor with TypeScript support
- Git for version control
Instructions
Step 1: Create Project Structure
my-lucidchart-project/
├── src/
│ ├── lucidchart/
│ │ ├── client.ts # Lucidchart client wrapper
│ │ ├── config.ts # Configuration management
│ │ └── utils.ts # Helper functions
│ └── index.ts
├── tests/
│ └── lucidchart.test.ts
├── .env.local # Local secrets (git-ignored)
├── .env.example # Template for team
└── package.json
Step 2: Configure Environment
# Copy environment template
cp .env.example .env.local
# Install dependencies
npm install
# Start development server
npm run dev
Step 3: Setup Hot Reload
{
"scripts": {
"dev": "tsx watch src/index.ts",
"test": "vitest",
"test:watch": "vitest --watch"
}
}
Step 4: Configure Testing
import { describe, it, expect, vi } from 'vitest';
import { LucidchartClient } from '../src/lucidchart/client';
describe('Lucidchart Client', () => {
it('should initialize with API key', () => {
const client = new LucidchartClient({ apiKey: 'test-key' });
expect(client).toBeDefined();
});
});
Output
- Working development environment with hot reload
- Configured test suite with mocking
- Environment variable management
- Fast iteration cycle for Lucidchart development
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Module not found | Missing dependency | Run npm install |
| Port in use | Another process | Kill process or change port |
| Env not loaded | Missing .env.local | Copy from .env.example |
| Test timeout | Slow network | Increase test timeout |
Examples
Mock Lucidchart Responses
vi.mock('@lucidchart/sdk', () => ({
LucidchartClient: vi.fn().mockImplementation(() => ({
// Mock methods here
})),
}));
Debug Mode
# Enable verbose logging
DEBUG=LUCIDCHART=* npm run dev
Resources
Optimize Lucidchart API performance with caching, batching, and connection pooling.
Lucidchart Performance Tuning
Overview
Optimize Lucidchart API performance with caching, batching, and connection pooling.
Prerequisites
- Lucidchart SDK installed
- Understanding of async patterns
- Redis or in-memory cache available (optional)
- Performance monitoring in place
Latency Benchmarks
| Operation | P50 | P95 | P99 |
|---|---|---|---|
| Read | 50ms | 150ms | 300ms |
| Write | 100ms | 250ms | 500ms |
| List | 75ms | 200ms | 400ms |
Caching Strategy
Response Caching
import { LRUCache } from 'lru-cache';
const cache = new LRUCache<string, any>({
max: 1000,
ttl: 60000, // 1 minute
updateAgeOnGet: true,
});
async function cachedLucidchartRequest<T>(
key: string,
fetcher: () => Promise<T>,
ttl?: number
): Promise<T> {
const cached = cache.get(key);
if (cached) return cached as T;
const result = await fetcher();
cache.set(key, result, { ttl });
return result;
}
Redis Caching (Distributed)
import Redis from 'ioredis';
const redis = new Redis(process.env.REDIS_URL);
async function cachedWithRedis<T>(
key: string,
fetcher: () => Promise<T>,
ttlSeconds = 60
): Promise<T> {
const cached = await redis.get(key);
if (cached) return JSON.parse(cached);
const result = await fetcher();
await redis.setex(key, ttlSeconds, JSON.stringify(result));
return result;
}
Request Batching
import DataLoader from 'dataloader';
const lucidchartLoader = new DataLoader<string, any>(
async (ids) => {
// Batch fetch from Lucidchart
const results = await lucidchartClient.batchGet(ids);
return ids.map(id => results.find(r => r.id === id) || null);
},
{
maxBatchSize: 100,
batchScheduleFn: callback => setTimeout(callback, 10),
}
);
// Usage - automatically batched
const [item1, item2, item3] = await Promise.all([
lucidchartLoader.load('id-1'),
lucidchartLoader.load('id-2'),
lucidchartLoader.load('id-3'),
]);
Connection Optimization
import { Agent } from 'https';
// Keep-alive connection pooling
const agent = new Agent({
keepAlive: true,
maxSockets: 10,
maxFreeSockets: 5,
timeout: 30000,
});
const client = new LucidchartClient({
apiKey: process.env.LUCIDCHART_API_KEY!,
httpAgent: agent,
});
Pagination Optimization
async function* paginatedLucidchartList<T>(
fetcher: (cursor?: string) => Promise<{ data: T[]; nextCursoExecute Lucidchart production deployment checklist and rollback procedures.
Lucidchart Production Checklist
Overview
Complete checklist for deploying Lucidchart integrations to production.
Prerequisites
- Staging environment tested and verified
- Production API keys available
- Deployment pipeline configured
- Monitoring and alerting ready
Instructions
Step 1: Pre-Deployment Configuration
- [ ] Production API keys in secure vault
- [ ] Environment variables set in deployment platform
- [ ] API key scopes are minimal (least privilege)
- [ ] Webhook endpoints configured with HTTPS
- [ ] Webhook secrets stored securely
Step 2: Code Quality Verification
- [ ] All tests passing (
npm test) - [ ] No hardcoded credentials
- [ ] Error handling covers all Lucidchart error types
- [ ] Rate limiting/backoff implemented
- [ ] Logging is production-appropriate
Step 3: Infrastructure Setup
- [ ] Health check endpoint includes Lucidchart connectivity
- [ ] Monitoring/alerting configured
- [ ] Circuit breaker pattern implemented
- [ ] Graceful degradation configured
Step 4: Documentation Requirements
- [ ] Incident runbook created
- [ ] Key rotation procedure documented
- [ ] Rollback procedure documented
- [ ] On-call escalation path defined
Step 5: Deploy with Gradual Rollout
# Pre-flight checks
curl -f https://staging.example.com/health
curl -s https://status.lucidchart.com
# Gradual rollout - start with canary (10%)
kubectl apply -f k8s/production.yaml
kubectl set image deployment/lucidchart-integration app=image:new --record
kubectl rollout pause deployment/lucidchart-integration
# Monitor canary traffic for 10 minutes
sleep 600
# Check error rates and latency before continuing
# If healthy, continue rollout to 50%
kubectl rollout resume deployment/lucidchart-integration
kubectl rollout pause deployment/lucidchart-integration
sleep 300
# Complete rollout to 100%
kubectl rollout resume deployment/lucidchart-integration
kubectl rollout status deployment/lucidchart-integration
Output
- Deployed Lucidchart integration
- Health checks passing
- Monitoring active
- Rollback procedure documented
Error Handling
| Alert | Condition | Severity |
|---|---|---|
| API Down | 5xx errors > 10/min | P1 |
| High Latency | p99 > 5000ms | P2 |
| Rate Limited | 429 errors > 5/min | P2 |
| Auth Failures | 401/403 errors > 0 | P1 |
Examples
Health Check Implementation
async function healthCheck(): Promise<{ status:Implement Lucidchart rate limiting, backoff, and idempotency patterns.
Lucidchart Rate Limits
Overview
Handle Lucidchart rate limits gracefully with exponential backoff and idempotency.
Prerequisites
- Lucidchart SDK installed
- Understanding of async/await patterns
- Access to rate limit headers
Instructions
Step 1: Understand Rate Limit Tiers
| Tier | Requests/min | Requests/day | Burst |
|---|---|---|---|
| Free | 60 | 1,000 | 10 |
| Pro | 300 | 10,000 | 50 |
| Enterprise | 1,000 | 100,000 | 200 |
Step 2: Implement Exponential Backoff with Jitter
async function withExponentialBackoff<T>(
operation: () => Promise<T>,
config = { maxRetries: 5, baseDelayMs: 1000, maxDelayMs: 32000, jitterMs: 500 }
): Promise<T> {
for (let attempt = 0; attempt <= config.maxRetries; attempt++) {
try {
return await operation();
} catch (error: any) {
if (attempt === config.maxRetries) throw error;
const status = error.status || error.response?.status;
if (status !== 429 && (status < 500 || status >= 600)) throw error;
// Exponential delay with jitter to prevent thundering herd
const exponentialDelay = config.baseDelayMs * Math.pow(2, attempt);
const jitter = Math.random() * config.jitterMs;
const delay = Math.min(exponentialDelay + jitter, config.maxDelayMs);
console.log(`Rate limited. Retrying in ${delay.toFixed(0)}ms...`);
await new Promise(r => setTimeout(r, delay));
}
}
throw new Error('Unreachable');
}
Step 3: Add Idempotency Keys
import { v4 as uuidv4 } from 'uuid';
import crypto from 'crypto';
// Generate deterministic key from operation params (for safe retries)
function generateIdempotencyKey(operation: string, params: Record<string, any>): string {
const data = JSON.stringify({ operation, params });
return crypto.createHash('sha256').update(data).digest('hex');
}
async function idempotentRequest<T>(
client: LucidchartClient,
params: Record<string, any>,
idempotencyKey?: string // Pass existing key for retries
): Promise<T> {
// Use provided key (for retries) or generate deterministic key from params
const key = idempotencyKey || generateIdempotencyKey(params.method || 'POST', params);
return client.request({
...params,
headers: { 'Idempotency-Key': key, ...params.headers },
});
}
Output
- Reliable API calls with automatic retry
- Idempotent requests preventing duplicates
- Rate limit headers properly handled
Error Handling
| Header | Description |
|---|
| Pattern | Use Case | Benefit |
|---|---|---|
| Safe wrapper | All API calls | Prevents uncaught exceptions |
| Retry logic | Transient failures | Improves reliability |
| Type guards | Response validation | Catches API changes |
| Logging | All operations | Debugging and monitoring |
Examples
Factory Pattern (Multi-tenant)
const clients = new Map<string, LucidchartClient>();
export function getClientForTenant(tenantId: string): LucidchartClient {
if (!clients.has(tenantId)) {
const apiKey = getTenantApiKey(tenantId);
clients.set(tenantId, nApply Lucidchart security best practices for secrets and access control.
Lucidchart Security Basics
Overview
Security best practices for Lucidchart API keys, tokens, and access control.
Prerequisites
- Lucidchart SDK installed
- Understanding of environment variables
- Access to Lucidchart dashboard
Instructions
Step 1: Configure Environment Variables
# .env (NEVER commit to git)
LUCIDCHART_API_KEY=sk_live_***
LUCIDCHART_SECRET=***
# .gitignore
.env
.env.local
.env.*.local
Step 2: Implement Secret Rotation
# 1. Generate new key in Lucidchart dashboard
# 2. Update environment variable
export LUCIDCHART_API_KEY="new_key_here"
# 3. Verify new key works
curl -H "Authorization: Bearer ${LUCIDCHART_API_KEY}" \
https://api.lucidchart.com/health
# 4. Revoke old key in dashboard
Step 3: Apply Least Privilege
| Environment | Recommended Scopes |
|---|---|
| Development | read:* |
| Staging | read:*, write:limited |
| Production | Only required scopes |
Output
- Secure API key storage
- Environment-specific access controls
- Audit logging enabled
Error Handling
| Security Issue | Detection | Mitigation |
|---|---|---|
| Exposed API key | Git scanning | Rotate immediately |
| Excessive scopes | Audit logs | Reduce permissions |
| Missing rotation | Key age check | Schedule rotation |
Examples
Service Account Pattern
const clients = {
reader: new LucidchartClient({
apiKey: process.env.LUCIDCHART_READ_KEY,
}),
writer: new LucidchartClient({
apiKey: process.env.LUCIDCHART_WRITE_KEY,
}),
};
Webhook Signature Verification
import crypto from 'crypto';
function verifyWebhookSignature(
payload: string, signature: string, secret: string
): boolean {
const expected = crypto.createHmac('sha256', secret).update(payload).digest('hex');
return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}
Security Checklist
- [ ] API keys in environment variables
- [ ]
.envfiles in.gitignore - [ ] Different keys for dev/staging/prod
- [ ] Minimal scopes per environment
- [ ] Webhook signatures validated
- [ ] Audit logging enabled
Audit Logging
interface AuditEntry {
timestamp: Date;
action: string;
userId: string;
resource: string;
result: 'successAnalyze, plan, and execute Lucidchart SDK upgrades with breaking change detection.
Lucidchart Upgrade & Migration
Overview
Guide for upgrading Lucidchart SDK versions and handling breaking changes.
Prerequisites
- Current Lucidchart SDK installed
- Git for version control
- Test suite available
- Staging environment
Instructions
Step 1: Check Current Version
npm list @lucidchart/sdk
npm view @lucidchart/sdk version
Step 2: Review Changelog
open https://github.com/lucidchart/sdk/releases
Step 3: Create Upgrade Branch
git checkout -b upgrade/lucidchart-sdk-vX.Y.Z
npm install @lucidchart/sdk@latest
npm test
Step 4: Handle Breaking Changes
Update import statements, configuration, and method signatures as needed.
Output
- Updated SDK version
- Fixed breaking changes
- Passing test suite
- Documented rollback procedure
Error Handling
| SDK Version | API Version | Node.js | Breaking Changes |
|---|---|---|---|
| 3.x | 2024-01 | 18+ | Major refactor |
| 2.x | 2023-06 | 16+ | Auth changes |
| 1.x | 2022-01 | 14+ | Initial release |
Examples
Import Changes
// Before (v1.x)
import { Client } from '@lucidchart/sdk';
// After (v2.x)
import { LucidchartClient } from '@lucidchart/sdk';
Configuration Changes
// Before (v1.x)
const client = new Client({ key: 'xxx' });
// After (v2.x)
const client = new LucidchartClient({
apiKey: 'xxx',
});
Rollback Procedure
npm install @lucidchart/sdk@1.x.x --save-exact
Deprecation Handling
// Monitor for deprecation warnings in development
if (process.env.NODE_ENV === 'development') {
process.on('warning', (warning) => {
if (warning.name === 'DeprecationWarning') {
console.warn('[Lucidchart]', warning.message);
// Log to tracking system for proactive updates
}
});
}
// Common deprecation patterns to watch for:
// - Renamed methods: client.oldMethod() -> client.newMethod()
// - Changed parameters: { key: 'x' } -> { apiKey: 'x' }
// - Removed features: Check release notes before upgrading
Resources
Next Steps
For CI integration during upgrades, see lucidchart-ci-integration
Implement Lucidchart webhook signature validation and event handling.
Lucidchart Webhooks & Events
Overview
Securely handle Lucidchart webhooks with signature validation and replay protection.
Prerequisites
- Lucidchart webhook secret configured
- HTTPS endpoint accessible from internet
- Understanding of cryptographic signatures
- Redis or database for idempotency (optional)
Webhook Endpoint Setup
Express.js
import express from 'express';
import crypto from 'crypto';
const app = express();
// IMPORTANT: Raw body needed for signature verification
app.post('/webhooks/lucidchart',
express.raw({ type: 'application/json' }),
async (req, res) => {
const signature = req.headers['x-lucidchart-signature'] as string;
const timestamp = req.headers['x-lucidchart-timestamp'] as string;
if (!verifyLucidchartSignature(req.body, signature, timestamp)) {
return res.status(401).json({ error: 'Invalid signature' });
}
const event = JSON.parse(req.body.toString());
await handleLucidchartEvent(event);
res.status(200).json({ received: true });
}
);
Signature Verification
function verifyLucidchartSignature(
payload: Buffer,
signature: string,
timestamp: string
): boolean {
const secret = process.env.LUCIDCHART_WEBHOOK_SECRET!;
// Reject old timestamps (replay attack protection)
const timestampAge = Date.now() - parseInt(timestamp) * 1000;
if (timestampAge > 300000) { // 5 minutes
console.error('Webhook timestamp too old');
return false;
}
// Compute expected signature
const signedPayload = `${timestamp}.${payload.toString()}`;
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(signedPayload)
.digest('hex');
// Timing-safe comparison
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expectedSignature)
);
}
Event Handler Pattern
type LucidchartEventType = 'resource.created' | 'resource.updated' | 'resource.deleted';
interface LucidchartEvent {
id: string;
type: LucidchartEventType;
data: Record<string, any>;
created: string;
}
const eventHandlers: Record<LucidchartEventType, (data: any) => Promise<void>> = {
'resource.created': async (data) => { /* handle */ },
'resource.updated': async (data) => { /* handle */ },
'resource.deleted': async (data) => { /* handle */ }
};
async function handleLucidchartEvent(event: LucidchartEvent): Promise<void> {
const handler = eventHandlers[event.type];
if (!handler) {
console.log(`Unhandled event type: ${event.type}`);
return;
}
try {
await handler(event.data);
console.log(`Processed ${event.type}: ${event.id}`);
} cReady to use lucidchart-pack?
Related Plugins
excel-analyst-pro
Professional financial modeling toolkit for Claude Code with auto-invoked Skills and Excel MCP integration. Build DCF models, LBO analysis, variance reports, and pivot tables using natural language.
brand-strategy-framework
A 7-part brand strategy framework for building comprehensive brand foundations - the same methodology top agencies use with Fortune 500 clients.
clay-pack
Complete Clay integration skill pack with 30 skills covering data enrichment, waterfall workflows, AI agents, and GTM automation. Flagship+ tier vendor pack.
instantly-pack
Complete Instantly integration skill pack with 24 skills covering cold email, outreach automation, and lead generation. Flagship tier vendor pack.
apollo-pack
Complete Apollo integration skill pack with 24 skills covering sales engagement, prospecting, sequencing, analytics, and outbound automation. Flagship tier vendor pack.
juicebox-pack
Complete Juicebox integration skill pack with 24 skills covering people data, enrichment, contact search, and AI-powered discovery. Flagship tier vendor pack.