PBJ SDK documentation

Package development

Build, validate, inspect, and publish the pbjspace package with its supported dual-module output and declarations.

Development commands

CommandPurpose
npm ciInstall the locked development dependencies.
npm run buildBuild ESM, CommonJS, declarations, and source maps.
npm testRun transport and resource tests with Vitest.
npm run typecheckCheck strict TypeScript across source, examples, and tests.
npm run lintRun ESLint across the SDK.
npm run format:checkVerify Prettier formatting.
npm run prepublishOnlyRun the complete release validation pipeline.
npm pack --dry-runInspect exactly what npm will publish.

Published output

ESM

dist/index.js

CommonJS

dist/index.cjs

ESM declarations

dist/index.d.ts

CJS declarations

dist/index.d.cts

Source maps

Included without embedded source

Entry points

Package root only

Test strategy

The test suite mocks Fetch only at the network boundary. It covers configuration, authentication, query encoding, responses, retries, deadlines, cancellation, pagination, task status updates, Solana option forwarding, and public routes.

Contract tests, not live verificationTests validate SDK behavior against its declared API contract; they do not claim that a deployed PBJ backend is available or compatible.

Release checklist

  1. Confirm backend contract compatibility.
  2. Run npm run prepublishOnly.
  3. Inspect output with npm pack --dry-run.
  4. Confirm package ownership and license metadata.
  5. Publish with npm publish --access public only when authorized.
shell
npm run prepublishOnly
npm pack --dry-run
npm publish --access public