PBJ SDK documentation

PBJ SDK

A typed JavaScript and TypeScript client for projects, tasks, GitHub repositories, Solana programs, wallet activity, treasury data, analytics, and AI insights.

Installation

Install the stable v1 package from npm. The SDK has zero runtime dependencies and supports ESM, CommonJS, and TypeScript declarations.

shell
npm install pbjspace

Initialize the client

Create one client and reuse it across your server process. API keys should stay in server-only environment variables.

ts
import { PBJClient } from "pbjspace";

const pbj = new PBJClient({
  apiKey: process.env.PBJ_API_KEY!,
  baseUrl: process.env.PBJ_API_URL,
  timeout: 10_000,
  network: "devnet",
});
Keep credentials private.Never expose a privileged PBJ key through a NEXT_PUBLIC_ environment variable.

One client, focused resources

PBJClient exposes ten resource clients backed by one shared HTTP transport. Resources own routes and types; the transport owns authentication, retries, deadlines, parsing, and typed errors.

Projects & tasks

Plan and execute product work.

Repositories & programs

Connect code and deployed Solana programs.

Wallets & treasury

Read onchain activity and balances.

Analytics & AI

Turn project signals into decisions.

Requirements

  • Node.js 18 or newer, or a modern browser with Fetch and AbortController.
  • A PBJ API key and access to a compatible PBJ REST API.
  • Server-side execution for privileged credentials.