Installation
Install the stable v1 package from npm. The SDK has zero runtime dependencies and supports ESM, CommonJS, and TypeScript declarations.
npm install pbjspaceInitialize the client
Create one client and reuse it across your server process. API keys should stay in server-only environment variables.
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",
});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.
