| name | customerio-install-auth |
| description | Install and configure Customer.io SDK/CLI authentication.
Use when setting up a new Customer.io integration, configuring API keys,
or initializing Customer.io in your project.
Trigger: "install customer.io", "setup customer.io", "customer.io auth",
"configure customer.io API key", "customer.io credentials".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(npx:*), Glob, Grep |
| version | 1.14.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","customer-io","api","authentication","setup"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Customer.io Install & Auth
Overview
Set up the customerio-node SDK and configure authentication for Customer.io's two API surfaces: the Track API (identify users, track events) and the App API (transactional messages, broadcasts, data queries).
Prerequisites
- Node.js 18+ with npm/pnpm
- Customer.io account at https://fly.customer.io
- Site ID + Track API Key from Settings > Workspace Settings > API & Webhook Credentials
- App API Key (bearer token) from the same page — needed for transactional messages and broadcasts
Two API Keys, Two Clients
| Client | Auth Method | Key Source | Use For |
|---|
TrackClient | Basic Auth (Site ID + API Key) | Track API credentials | identify(), track(), trackAnonymous(), suppress(), destroy() |
APIClient | Bearer Token (App API Key) | App API credentials | sendEmail(), sendPush(), triggerBroadcast() |
Instructions
Step 1: Install the SDK
npm install customerio-node
The package exports TrackClient, APIClient, RegionUS, RegionEU, SendEmailRequest, and SendPushRequest.
Step 2: Configure Environment Variables
CUSTOMERIO_SITE_ID=your-site-id-here
CUSTOMERIO_TRACK_API_KEY=your-track-api-key-here
CUSTOMERIO_APP_API_KEY=your-app-api-key-here
CUSTOMERIO_REGION=us
Add .env to .gitignore if not already there.
Step 3: Create the Track Client
import { , , } ;
() {
process.. === ? : ;
}
: | = ;
(): {
(!trackClient) {
siteId = process..;
apiKey = process..;
(!siteId || !apiKey) {
(
);
}
trackClient = (siteId, apiKey, { : () });
}
trackClient;
}