SpeedCurve CLI

raw JSON →
2.0.10 verified Sat May 09 auth: no javascript

Official SpeedCurve CLI and Node.js API for interacting with the SpeedCurve synthetic monitoring service. Version 2.0.10, released regularly via npm. Supports triggering deploys, monitoring deploy status, fetching synthetic test results, listing sites, and checking performance budgets. Unlike other API wrappers, this is the official package maintained by SpeedCurve, includes TypeScript definitions, and offers both CLI and programmatic API. Requires Node.js 8+ and a SpeedCurve API key.

error speedcurve: command not found
cause CLI not installed globally or not in PATH
fix
Install globally: npm install -g speedcurve or use npx: npx speedcurve deploy
error Error: API key is required
cause Missing SPEEDCURVE_API_KEY environment variable or --key flag
fix
Set env variable: export SPEEDCURVE_API_KEY=your_key or pass --key: speedcurve deploy --key=your_key
breaking Version 2.x requires Node.js version 8 or higher. Node.js 6 and below are not supported.
fix Upgrade Node.js to version 8 or later.
deprecated The `--key` flag and `SPEEDCURVE_API_KEY` environment variable are still supported, but programmatic usage now expects the API key as a constructor argument.
fix Pass API key as first argument to SpeedCurve constructor: new SpeedCurve('your-key').
gotcha The `deploy` method's 'site' parameter expects site IDs or names, but mixing types can cause errors. Use `siteId` for numeric IDs and `siteName` for strings.
fix Use `siteId` (array of numbers) or `siteName` (array of strings) consistently.
npm install speedcurve
yarn add speedcurve
pnpm add speedcurve

Creates a SpeedCurve API client, triggers a deploy with note and detail, waits for completion, and checks budgets.

import SpeedCurve from 'speedcurve';

const api = new SpeedCurve(process.env.SPEEDCURVE_API_KEY ?? '');

async function triggerDeploy() {
  try {
    const result = await api.deploy({
      note: 'v2.0.0',
      detail: 'Performance improvements',
      siteId: [1043801],
      wait: true,
      checkBudgets: true,
    });
    console.log('Deploy ID:', result.deployId);
    console.log('Tests:', result.tests);
  } catch (err) {
    console.error('Deploy failed:', err.message);
  }
}

triggerDeploy();