Skip to Content
px402Devnet
SDK

Platform client

Signed calls to the provider platform from TypeScript.

import { createPlatformClient, openTurnkeyIdentity } from "@px402-tech/sdk";
import { MeResponseSchema } from "@px402-tech/types";

const identity = await openTurnkeyIdentity({ home, profile: "default", passphrase });
const client = createPlatformClient({
  baseUrl: "https://devnet.platform.px402.tech",
  turnkeyUrl: "https://api.turnkey.com",
  identity,
});

const me = await client.call("POST", "/me", {}, MeResponseSchema);

Import the key once with importTurnkeyIdentity or px402 identity init --import. Each call mints a Turnkey token bound to the method, path, query, body and a nonce, and the platform accepts it once.

call(method, path, { query?, body? }, schema) validates the response against the zod schema. Paths start with / and carry no query string. A refusal throws PlatformApiError with status, code and traceId.