Skip to content

Quickstart

The Perfect Paw SDK is a TypeScript/JavaScript client library that simplifies access to the Perfect Paw API. Use it to interact with the Perfect Paw platform from your own applications.

Prerequisites

  • Node.js 20 or later
  • npm (included with Node.js)
  • A Perfect Paw accountsign up here (coming soon) if you don't have one

Installation

npm install @perfect-paw/sdk

Authentication

The SDK authenticates requests using a JSON Web Token (JWT). To obtain your token:

  1. Log in at api.perfectpaw.com
  2. Navigate to your Profile page
  3. Copy your JWT from the profile page

Set it as an environment variable:

export JWT="YOUR_JWT"

OAuth 2.0 / OIDC Support

Future versions of the SDK will provide built-in helper functions for the OAuth 2.0 / OIDC authentication flow. For now, retrieve the JWT manually as described above.

Making Your First API Call

Create a file called index.ts and add the following:

import { ApiClient } from "@perfect-paw/sdk";

// Read the JWT from an environment variable
const jwt = process.env.JWT ?? "";
const client = new ApiClient(jwt);

async function main() {
  try {
    const data = await client.get("/api/v1/info");
    console.log(JSON.stringify(data, null, 2));
  } catch (error: any) {
    console.error(
      `Error: ${error.status} - ${error.response?.data?.error}: ${error.response?.data?.message}`,
    );
  }
}

main();

Run the file using tsx (recommended for TypeScript):

npx tsx index.ts

ApiClient Reference

Method Description
new ApiClient(jwt) Create a new client authenticated with the given JWT
client.get(path) Send a GET request to the specified API endpoint

All methods return a Promise that resolves with the parsed JSON response body, or rejects with an error object containing status and response.data fields.

More Coming Soon

The SDK is under active development. As the Perfect Paw platform expands, additional endpoints and capabilities will be added. Check the Perfect Paw API for the latest available functionality.


Updated: 2026-02-16