Integration

TypeScript / JavaScript SDK @pathly/sdk

Official npm client: create scenarios, paginate, Idempotency-Key and Retry-After.

OpenAPI contractIssue an API keyFree Solo account

Full document, no authentication, ready for your client generator.

TypeScript / JavaScript SDK

npm package @pathly/sdk (monorepo, createChain for a Chain). HTTP client with no heavy runtime dependency: Idempotency-Key, Retry-After, cursor pagination. The pathly-sdk 0.1 package accepts httpChain on createScenario, without a helper.

Pass PATHLY_API_TOKEN to the PathlyClient constructor. Default base URL: https://api.pathlyhq.com. For a post-deploy smoke, combine this SDK with the GitHub Action (run-scenario) or a curl job on /v1.

Install, Ping and Chain

npm i @pathly/sdk
export PATHLY_API_TOKEN=sp_…

import { PathlyClient } from "@pathly/sdk";

const client = new PathlyClient({ token: process.env.PATHLY_API_TOKEN });
const ping = await client.createScenario({
  name: "Checkout",
  url: "https://www.example.com/cart",
  intervalSec: 300,
  expectText: "Your cart",
});
const chain = await client.createChain({
  name: "Login then /me",
  intervalSec: 300,
  hops: [
    { name: "Login", method: "POST", url: "https://api.example.com/login", assertStatus: 200 },
    { name: "Me", method: "GET", url: "https://api.example.com/me", assertStatus: 200 },
  ],
});
console.log(ping.id, chain.id);

List with pagination

for await (const row of client.paginate((cursor) => client.listScenarios({ cursor }))) {
  console.log(row.id, row.name);
}

ESM one-liner (CI)

node --input-type=module -e "import { PathlyClient } from '@pathly/sdk'; const c=new PathlyClient({ token: process.env.PATHLY_API_TOKEN }); console.log(await c.listScenarios());"