PerspectPerspectDocs
Go to Admin
View as Markdown

v2 Client

The top-level PerspectApiV2Client is the single entry point to every v2 resource — sites, content, products, orders, webhooks, and the rest. v1 is deprecated; all new integrations must use v2.

Do not use /api/v1, PerspectApiClient, createPerspectApiClient, or src/client/* in new code. v1 sunsets on 2026-06-01.

See the API Reference for the full type and function surface, regenerated from source on every build.

Quick Start

import { createPerspectApiV2Client } from 'perspectapi-ts-sdk/v2';

const client = createPerspectApiV2Client({
  baseUrl: process.env.PERSPECTAPI_BASE_URL!,
  apiKey: process.env.PERSPECTAPI_API_KEY!,
});

const site = await client.sites.get('my-site');