Skip to main content

Prerequisites

Install the SDK

pnpm add @penumbra-systems/platform
npm and yarn work too:
npm install @penumbra-systems/platform

Set your key

Keys are prefixed with pnbr-. Keep them out of source control; read them from the environment.
export PENUMBRA_API_KEY="pnbr-..."

Create a client

import { createPenumbra } from "@penumbra-systems/platform";

const pb = createPenumbra({ apiKey: process.env.PENUMBRA_API_KEY! });
The client targets the production API (https://pnbr.io/v1) by default. Override baseUrl for a self-hosted or staging environment:
const pb = createPenumbra({
  apiKey: process.env.PENUMBRA_API_KEY!,
  baseUrl: "https://staging.pnbr.io/v1",
});

Projects

Your key is scoped to a single project or to your whole organization.
  • A key scoped to a single project makes projectId implicit, so you can omit it.
  • A key that spans multiple projects requires projectId on calls that take it.

Verify the connection

A read-only call confirms your key works without writing anything:
const ontology = await pb.ontology({ format: "markdown" });
console.log(ontology.markdown || ontology.content);
Next, run the quickstart.