{"id":28202,"library":"speedcurve","title":"SpeedCurve CLI","description":"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.","status":"active","version":"2.0.10","language":"javascript","source_language":"en","source_url":"https://github.com/SpeedCurve-Metrics/speedcurve-cli","tags":["javascript","typescript"],"install":[{"cmd":"npm install speedcurve","lang":"bash","label":"npm"},{"cmd":"yarn add speedcurve","lang":"bash","label":"yarn"},{"cmd":"pnpm add speedcurve","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export for the API client class. CommonJS require works but preferred is ESM.","wrong":"const SpeedCurve = require('speedcurve')","symbol":"SpeedCurve","correct":"import SpeedCurve from 'speedcurve'"},{"note":"CJS require returns the default export directly. No named exports.","wrong":null,"symbol":"default (API client)","correct":"const speedcurve = require('speedcurve')"},{"note":"Use 'import type' for type-only imports when using TypeScript to avoid runtime overhead.","wrong":"import { SpeedCurveOptions } from 'speedcurve'","symbol":"Types (TypeScript)","correct":"import type { SpeedCurveOptions, DeployOptions } from 'speedcurve'"}],"quickstart":{"code":"import SpeedCurve from 'speedcurve';\n\nconst api = new SpeedCurve(process.env.SPEEDCURVE_API_KEY ?? '');\n\nasync function triggerDeploy() {\n  try {\n    const result = await api.deploy({\n      note: 'v2.0.0',\n      detail: 'Performance improvements',\n      siteId: [1043801],\n      wait: true,\n      checkBudgets: true,\n    });\n    console.log('Deploy ID:', result.deployId);\n    console.log('Tests:', result.tests);\n  } catch (err) {\n    console.error('Deploy failed:', err.message);\n  }\n}\n\ntriggerDeploy();","lang":"typescript","description":"Creates a SpeedCurve API client, triggers a deploy with note and detail, waits for completion, and checks budgets."},"warnings":[{"fix":"Upgrade Node.js to version 8 or later.","message":"Version 2.x requires Node.js version 8 or higher. Node.js 6 and below are not supported.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Pass API key as first argument to SpeedCurve constructor: new SpeedCurve('your-key').","message":"The `--key` flag and `SPEEDCURVE_API_KEY` environment variable are still supported, but programmatic usage now expects the API key as a constructor argument.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Use `siteId` (array of numbers) or `siteName` (array of strings) consistently.","message":"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.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install globally: `npm install -g speedcurve` or use npx: `npx speedcurve deploy`","cause":"CLI not installed globally or not in PATH","error":"speedcurve: command not found"},{"fix":"Set env variable: `export SPEEDCURVE_API_KEY=your_key` or pass --key: `speedcurve deploy --key=your_key`","cause":"Missing SPEEDCURVE_API_KEY environment variable or --key flag","error":"Error: API key is required"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}