Config as Code
Once you’ve gone through the Quickstart and have a working setup, manage it as code. A single beeps.config.ts file is the source of truth, checked into your repo, and deployed via CI.
Full SDK config
Section titled “Full SDK config”This is the complete beeps.config.ts that wires up the quickstart end-to-end. Because every entity sets externalKey, the file is idempotent: safe to re-run without creating duplicates. Treat it like a database migration.
import { BeepsClient } from "@beepsdev/sdk";
async function configure() { const client = new BeepsClient({ accessToken: process.env.BEEPS_ACCESS_TOKEN, });
// 1. Create relay const relay = await client.relay.create({ name: "production relay", description: "routes critical production incidents", externalKey: "production::relay", });
// 2. Create schedule const schedule = await client.schedule.create({ name: "Primary On-Call", relayId: relay.id, type: "weekly", handoffDay: "monday", handoffTime: "09:00", // startAt omitted -> schedule starts immediately externalKey: "primary::schedule", });
// 3. Add team members by email await client.schedule.addMember(schedule.id, { email: "alice@example.com" }); await client.schedule.addMember(schedule.id, { email: "bob@example.com" });
// 4. Contact methods are managed in Settings → Profile in the dashboard.
// 5. Create AI integration const integration = await client.integration.create({ name: "Cursor Production Agent", provider: "cursor", apiKey: process.env.CURSOR_API_KEY, externalKey: "agents::cursor::integration", });
// 6. Create relay rules (parallel: agents + humans) await client.relay.rules.create(relay.id, { name: "AI Agent Auto-Triage", externalKey: "agents::cursor", ruleType: "agent", group: "agents", order: 1, config: { agentType: "cursor", integrationId: integration.id, repository: "https://github.com/your-org/your-repo", autoCreatePr: true, }, enabled: true, });
await client.relay.rules.create(relay.id, { name: "Notify On-Call Engineer", externalKey: "humans::primary::schedule-notify", ruleType: "schedule_notify", group: "humans", order: 1, config: { scheduleId: schedule.id }, enabled: true, });
// 7. Verify const rules = await client.relay.rules.list(relay.id); console.log("\nRelay Rules:"); rules.forEach((rule) => { console.log(` [${rule.group}] ${rule.name}`); console.log(` Type: ${rule.ruleType}`); console.log(` Enabled: ${rule.enabled}`); });}
configure().catch(console.error);Run it:
export BEEPS_ACCESS_TOKEN="bat_your_token_here"export CURSOR_API_KEY="cursor_api_key_here"
npx tsx beeps.config.tsDeploy via CI
Section titled “Deploy via CI”Treat beeps.config.ts like infrastructure. Every change goes through PR review.
GitHub Actions
Section titled “GitHub Actions”name: Deploy beeps config
on: push: branches: [main] paths: [beeps.config.ts]
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 24 - run: npm install @beepsdev/sdk - run: npx tsx beeps.config.ts env: BEEPS_ACCESS_TOKEN: ${{ secrets.BEEPS_ACCESS_TOKEN }} CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}For a CLI-driven plan/apply flow that previews diffs before applying (à la Terraform), see CLI Config-as-Code.
Understanding parallel execution
Section titled “Understanding parallel execution”Alert Received |Relay: "production relay" | |-- [agents] AI Agent Auto-Triage --> Cursor starts working | |-- [humans] Notify On-Call Engineer --> Email/SMS sentRules with the same group run sequentially in order order. Rules in different groups run in parallel.
Common customizations
Section titled “Common customizations”Sequential instead of parallel
Section titled “Sequential instead of parallel”To run AI first, then escalate to humans only if the AI doesn’t resolve in time, put both rules in the same group:
await client.relay.rules.create(relay.id, { name: "Try AI first", ruleType: "agent", group: "default", order: 1, config: { agentType: "cursor", integrationId: integration.id, repository: "https://github.com/your-org/your-repo", },});
await client.relay.rules.create(relay.id, { name: "Escalate to humans", ruleType: "schedule_notify", group: "default", order: 2, config: { scheduleId: schedule.id },});Add a secondary schedule
Section titled “Add a secondary schedule”await client.relay.rules.create(relay.id, { name: "Escalate to backup", ruleType: "schedule_notify", group: "humans", order: 2, config: { scheduleId: backupSchedule.id },});Webhook fan-out
Section titled “Webhook fan-out”await client.relay.rules.create(relay.id, { name: "Post to Slack ops channel", ruleType: "webhook", group: "notifications", order: 1, config: { endpoint: "https://hooks.slack.com/services/...", method: "POST", headers: { "Content-Type": "application/json" }, },});See Relay Rules for the full rule type reference.