From hubspot-pack
Executes HubSpot production deployment checklist for CRM integrations, including verifications, TypeScript health check endpoint, and monitoring setup.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin hubspot-packThis skill is limited to using the following tools:
Complete checklist for deploying HubSpot CRM integrations to production with health checks, monitoring, and rollback procedures.
Deploys HubSpot-powered apps to Vercel, Fly.io, and Cloud Run with secret management for access tokens, health checks, and platform configs.
Runs Intercom production checklist for auth, API errors/rate limits, webhooks, data handling, monitoring before deploying integrations to prod.
Runs automated production checklist for Apollo.io integrations, validating API auth, key management, rate limiting, gitignore, and API health via TypeScript scripts.
Share bugs, ideas, or general feedback.
Complete checklist for deploying HubSpot CRM integrations to production with health checks, monitoring, and rollback procedures.
.env files in .gitignoregrep -r "pat-na1" src/)numberOfApiCallRetries: 3)import * as hubspot from '@hubspot/api-client';
interface HealthCheckResult {
status: 'healthy' | 'degraded' | 'unhealthy';
hubspot: {
connected: boolean;
latencyMs: number;
rateLimitRemaining?: number;
};
timestamp: string;
}
async function hubspotHealthCheck(): Promise<HealthCheckResult> {
const client = new hubspot.Client({
accessToken: process.env.HUBSPOT_ACCESS_TOKEN!,
});
const start = Date.now();
try {
// Cheapest possible API call: fetch 1 contact
await client.crm.contacts.basicApi.getPage(1);
return {
status: 'healthy',
hubspot: {
connected: true,
latencyMs: Date.now() - start,
},
timestamp: new Date().toISOString(),
};
} catch (error: any) {
const status = error?.code || error?.statusCode || 500;
return {
status: status === 429 ? 'degraded' : 'unhealthy',
hubspot: {
connected: false,
latencyMs: Date.now() - start,
},
timestamp: new Date().toISOString(),
};
}
}
// Express endpoint
app.get('/health', async (req, res) => {
const result = await hubspotHealthCheck();
const httpStatus = result.status === 'healthy' ? 200 :
result.status === 'degraded' ? 200 : 503;
res.status(httpStatus).json(result);
});
| Alert | Condition | Severity |
|---|---|---|
| HubSpot unreachable | Health check fails 3x | P1 |
| High error rate | 5xx errors > 10/min | P1 |
| Auth failure | Any 401/403 response | P1 (token revoked?) |
| Rate limited | 429 errors > 5/min | P2 |
| High latency | p95 > 3000ms | P2 |
| Daily quota low | < 10% remaining | P3 |
async function withHubSpotFallback<T>(
operation: () => Promise<T>,
fallback: T
): Promise<{ data: T; degraded: boolean }> {
try {
const data = await operation();
return { data, degraded: false };
} catch (error: any) {
console.error('HubSpot call failed, using fallback:', {
status: error?.code,
message: error?.body?.message,
correlationId: error?.body?.correlationId,
});
return { data: fallback, degraded: true };
}
}
#!/bin/bash
# post-deploy-verify.sh
echo "=== HubSpot Post-Deploy Verification ==="
# 1. Health check
HEALTH=$(curl -sf https://your-app.com/health | jq -r '.hubspot.connected')
echo "HubSpot connected: $HEALTH"
[ "$HEALTH" = "true" ] || { echo "FAIL: HubSpot not connected"; exit 1; }
# 2. Verify CRM access
STATUS=$(curl -so /dev/null -w "%{http_code}" \
https://api.hubapi.com/crm/v3/objects/contacts?limit=1 \
-H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN")
echo "CRM API status: $STATUS"
[ "$STATUS" = "200" ] || { echo "FAIL: CRM access denied"; exit 1; }
# 3. Check rate limit headroom
REMAINING=$(curl -sI https://api.hubapi.com/crm/v3/objects/contacts?limit=1 \
-H "Authorization: Bearer $HUBSPOT_ACCESS_TOKEN" \
| grep -i 'x-hubspot-ratelimit-daily-remaining' | awk '{print $2}' | tr -d '\r')
echo "Daily rate limit remaining: $REMAINING"
# 4. Check HubSpot status page
HS_STATUS=$(curl -s https://status.hubspot.com/api/v2/summary.json | jq -r '.status.description')
echo "HubSpot platform status: $HS_STATUS"
echo "=== Verification complete ==="
| Issue | Response |
|---|---|
| Health check fails after deploy | Rollback immediately |
| 401 in production | Token was regenerated -- update secret and redeploy |
| 429 spike after deploy | New code making too many calls -- add batching/caching |
| 5xx from HubSpot | Check status.hubspot.com -- enable fallback mode |
For version upgrades, see hubspot-upgrade-migration.