@plainrouter/sdk
v0.10.1
Published
Generated TypeScript client and Zod schemas for the Plainrouter API, supporting Meta conversion tracking and governed ad changes.
Maintainers
Readme
@plainrouter/sdk
Generated TypeScript client and Zod schemas for Plainrouter's signed OpenAPI contract.
Official project: plainrouter.com · documentation · source
Report SDK issues in the Plainrouter SDK issue tracker.
This package is in 0.x development. Its interface is unstable and carries no
support promise yet.
Configure authentication by injecting a signalTrackerSecret bearer token with
the exported client configuration helper. No credential is embedded in the
package.
Copy a failed plan to a fresh draft with a plan-writer bearer token:
import { configurePlainrouter, launchPlansCopy } from '@plainrouter/sdk';
configurePlainrouter({ signalTrackerSecret: process.env.PLAINROUTER_TOKEN! });
const result = await launchPlansCopy({
path: { workspace: 1, deployment_plan: 'failed-plan-id' },
});configurePlainrouter() defaults to Accept: application/json. Override it with headers: { Accept: "..." } in configuration or per call. API redirects use manual handling and throw ApiRedirectError, carrying status, headers, and response, regardless of throwOnError or result style. Browsers can hide cross-origin redirect status and Location (opaque redirects); these fail without returning data. These defaults apply to the configured SDK client. Independently constructed generated clients require their own transport policy.
The six paginated list operations accept page values from 1 through 10^16. JavaScript cannot exactly represent every integer above Number.MAX_SAFE_INTEGER, and the validation schemas refuse values above it. The request functions send any number they are given; the server validates the page bounds.
