Skip to content

Repository files navigation

@wyre-ai/node-scalepad

Node.js client library for the ScalePad platform APIs — Core, Lifecycle Manager, ControlMap, Backup Radar, and Quoter — with zero runtime dependencies (native fetch only).

Installation

The package is published to GitHub Packages. Add to your .npmrc:

@wyre-ai:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}

Then:

export NODE_AUTH_TOKEN=$(gh auth token)
npm install @wyre-ai/node-scalepad

Usage

import{ScalePadClient}from'@wyre-ai/node-scalepad';constclient=newScalePadClient({apiKey: process.env.SCALEPAD_API_KEY!,});// Core platform dataconstclients=awaitclient.coreClients.list();// Lifecycle Managerconstinitiatives=awaitclient.lmInitiatives.list();// ControlMap (region-aware)constrisks=awaitclient.cmRisks.list();// Quoter (ScalePad-hosted by default)constquotes=awaitclient.quoterQuotes.list();

Configuration

OptionRequiredDefaultDescription
apiKeyyesScalePad platform API key (generated in the ScalePad app by an Administrator). Sent as x-api-key.
regionnousData-residency region: us, eu, ca, or au. Applies to ControlMap (us/eu/ca/au) and Backup Radar (us/eu). Core and Lifecycle Manager are US-only.
quoterClientIdnoQuoter OAuth client ID — only for the standalone api.quoter.com API (Account Owner generates it in Quoter Account > API Keys).
quoterClientSecretnoQuoter OAuth client secret, paired with quoterClientId.
baseUrlnohttps://api.scalepad.comOverride for the ScalePad platform base URL.
quoterBaseUrlnohttps://api.quoter.comOverride for the standalone Quoter base URL.
maxRetriesno3Retries for network errors, 429s, and 5xx responses.
rateLimitno50 req / 5 sToken-bucket override: { maxRequests, windowMs }.

Products and resources

One ScalePad API key covers every product; endpoints for a product you are not subscribed to return HTTP 402 (PaymentRequiredError).

ProductResources
CorecoreClients, coreAssets, coreService
Lifecycle ManagerlmClients, lmAssets, lmInitiatives, lmGoals, lmMeetings, lmActionItems, lmAssessments, lmDeliverables, lmBudget, lmContracts, lmWorkspace
ControlMapcmHealth, cmRisks, cmControls, cmEvidence, cmPolicies, cmFrameworks, cmAssessments, cmActionItems
Backup RadarbrBackups
QuoterquoterQuotes, quoterCatalog, quoterContacts, quoterSuppliers, quoterAuth

Quoter: hosted vs standalone

Quoter is reachable two ways; the SDK picks automatically:

  • ScalePad-hosted (default, recommended):https://api.scalepad.com/quoter with your ScalePad API key. Kebab-case paths, shared 50 req/5 s rate limit, and a superset surface (fetch/publish quote, quote sections).
  • Standalone (api.quoter.com): used when you supply quoterClientId + quoterClientSecret. OAuth2 client_credentials — the SDK mints a Bearer access token (1 h TTL), refreshes it via POST /v1/auth/refresh, and on a 401 refreshes and retries the request once. 5 req/s rate limit, page + limit pagination, and snake_case paths (the SDK's canonical paths follow the hosted kebab-case form).

client.quoterAuth always targets the standalone API — its authorize/refresh endpoints exist only there.

Errors

All API failures throw a subclass of ScalePadError carrying statusCode and the raw response body:

ErrorStatusMeaning
ValidationError400Bad request (errors array when the API sends one)
AuthenticationError401Invalid/missing credentials
PaymentRequiredError402No active subscription for that product
ForbiddenError403Key lacks access
NotFoundError404Resource not found
RateLimitError429Rate limited (retryAfter seconds)
ServerError5xxUpstream failure (retried automatically)

Pagination

ScalePad platform APIs paginate with cursor + page_size (1–200). The paginate helper walks every page:

import{paginate}from'@wyre-ai/node-scalepad';forawait(constitemofpaginate((cursor)=>client.coreClients.list({ cursor,page_size: 200}))){console.log(item);}

The standalone Quoter API uses page + limit (max 100) instead.

Rate limiting

ScalePad allows 50 requests per 5 seconds per API key across all products. The client enforces this locally with a token bucket, and additionally honors Retry-After on any 429 the API returns. Standalone Quoter traffic gets its own 5 req/s bucket.

Development

export NODE_AUTH_TOKEN=$(gh auth token)
npm ci
npm run build # tsup — dual ESM + CJS with .d.ts
npm test# vitest + msw

See CONTRIBUTING.md for conventions.

License

Apache-2.0 — see LICENSE.

About

Node.js/TypeScript client library for the ScalePad API (Lifecycle Manager, Backup Radar, ControlMap, Quoter)

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages