sdk
Node / TypeScript

Node / TypeScript SDK

npm version (opens in a new tab) License: MIT (opens in a new tab)

Repository: github.com/bissaphq/bissap-sdk (opens in a new tab)

Install

npm install @bissap/sdk

Quick Example

import express from "express";
import { enableAgentAccess } from "@bissap/sdk";
import { z } from "zod";
 
const app = express();
 
enableAgentAccess(app, {
  userResolver: (req) => req.user.id,
  scopes: ["read", "write"],
 
  intents: {
    ping: {
      name: "ping",
      requiredScopes: ["read"],
      input: z.object({}).optional(),
      handler: async () => ({ ok: true }),
    },
  },
 
  strictIntents: true,
  onAgentIntent: async () => { throw new Error("All intents handled via registry"); },
});
 
app.listen(3000);

See the Node quickstart for a full walkthrough.

Key Features

  • Intent registry with Zod schema validation
  • strictIntents: true rejects unknown intents (404)
  • Scoped API keys (bs_live_ prefix, SHA-256 hashed)
  • Per-key rate limiting (in-memory)
  • Local enforcement (denyKeyLocally, flagKey)
  • Local, hybrid, and cloud key management modes

Error Codes

See Error codes reference for the full list.