Deploy applications that integrate with Clay's data enrichment API to production. Covers setting up API credentials, configuring webhook endpoints for enrichment callbacks, and deploying to Vercel, Docker, or Cloud Run with proper secrets management for Clay API access.
# Vercel
vercel env add CLAY_API_KEY production
vercel env add CLAY_WEBHOOK_SECRET production
# Docker
echo "CLAY_API_KEY=your-key" >> .env.production
# Cloud Run
echo -n "your-key" | gcloud secrets create clay-api-key --data-file=-
// config/clay.ts
export function getClayConfig() {
return {
apiKey: process.env.CLAY_API_KEY!,
baseUrl: "https://api.clay.com/v1",
webhookSecret: process.env.CLAY_WEBHOOK_SECRET!,
webhookUrl: process.env.CLAY_WEBHOOK_URL || "https://api.yourapp.com/webhooks/clay",
};
}
FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000 # 3000: 3 seconds in ms
CMD ["node", "dist/index.js"]
set -euo pipefail
docker build -t clay-integration .
docker run -d \
-e CLAY_API_KEY="$CLAY_API_KEY" \
-e CLAY_WEBHOOK_SECRET="$CLAY_WEBHOOK_SECRET" \
-p 3000:3000 clay-integration # 3000: 3 seconds in ms
vercel env add CLAY_API_KEY production
vercel --prod
export async function GET() {
try {
const response = await fetch("https://api.clay.com/v1/tables", {
headers: { "Authorization": `Bearer ${process.env.CLAY_API_KEY}` },
});
return Response.json({ status: response.ok ? "healthy" : "degraded" });
} catch {
return Response.json({ status: "unhealthy" }, { status: 503 }); # HTTP 503 Service Unavailable
}
}
| Issue | Cause | Solution |
|---|---|---|
| API key rejected | Key invalid or expired | Regenerate key in Clay dashboard |
| Webhook not received | URL not accessible | Verify HTTPS endpoint is public |
| Rate limited | Too many enrichment calls | Implement request queuing |
| Missing enrichment data | Table not configured | Verify table ID and column setup |
Basic usage: Apply clay deploy integration to a standard project setup with default configuration options.
Advanced scenario: Customize clay deploy integration for production environments with multiple constraints and team-specific requirements.
For webhook handling, see clay-webhooks-events.