pasbydocs
Resources

Client libraries

Official JavaScript, Node, Next.js, and React SDKs for pasby APIs and OIDC.

The recommended way to call pasby is through an official SDK. Libraries handle x-api-key + x-access-secret, request shapes, and (where applicable) OIDC redirects.

REST remains the canonical contract — see the API reference when adding a new language wrapper.

Choose a package

PackageUse when
@finsel-dgi/pasbyNode.js / server — v2 identification, signing, flow ping/cancel, documents
@finsel-dgi/pasby-nextNext.js App Router — OIDC login routes, handshake, branded UI
@finsel-dgi/pasby-reactReactloginWithSecret and hosted identification helpers
flowchart LR
  subgraph server [Server-side REST v2]
    A["@finsel-dgi/pasby"]
  end
  subgraph web [Hosted OIDC web]
    B["@finsel-dgi/pasby-next"]
    C["@finsel-dgi/pasby-react"]
  end
  API["l.pasby.africa / s.pasby.africa"]
  OIDC["oauth.pasby.africa"]
  A --> API
  B --> OIDC
  C --> OIDC

Node.js — @finsel-dgi/pasby

Fine-tuned for server-side TypeScript and JavaScript. v2 only in typings.

npm install @finsel-dgi/pasby
import { Pasby } from "@finsel-dgi/pasby";

const pasby = new Pasby({
  apikeyAuth: "bk-test_YOUR_KEY",
  appSecretKey: "YOUR_APP_SECRET",
  basePath: "https://s.pasby.africa",
});

const { data } = await pasby.identification.wildcard({
  action: "signup",
  claims: ["naming.given", "contact.email"],
  seeds: 4,
  payload: "Create your account",
});

await pasby.flows.ping({ request: data.data.request.id });

Full reference: TypeScript / Node.js SDK — method map, errors, gaps (SSE, OIDC).

Repository: github.com/Finsel-DGI/pasby-typescript-sdk

Next.js (App Router)

Package: @finsel-dgi/pasby-next

Server and client utilities for pasby OAuth / OIDC in Next.js — login routes, handshake callback, branded login UI.

Full guide: Next.js OIDC

npm install @finsel-dgi/pasby-next
"use client";
import { LoginButton } from "@finsel-dgi/pasby-next";

export function SignIn() {
  return <LoginButton action="login" fallbackPath="/dashboard" variant="dark" />;
}
// app/api/eid/[auth]/route.ts
import { handler } from "@finsel-dgi/pasby-next/server";
import { NextRequest } from "next/server";

const pasbyHandler = handler(
  {
    claims: ["naming.given", "contact.email"],
    action: "login",
    payload: "Sign in to your app",
  },
  "/auth/error",
);

export async function GET(
  request: NextRequest,
  { params }: { params: Promise<{ auth: string }> },
) {
  return pasbyHandler(request, { params: await params });
}

Repository: github.com/Finsel-DGI/pasby-nextjs

React

Package: @finsel-dgi/pasby-react

Hosted identification from Express, Fastify, or custom Node backends.

Full guide: React OIDC

npm install @finsel-dgi/pasby-react
import { loginWithSecret, tokenSwap, eidResource } from "@finsel-dgi/pasby-react/server";

const { redirect, pkceverifier } = await loginWithSecret({
  claims: ["naming.given", "contact.email"],
  action: "login",
  payload: "Sign in to your app",
  redirect_uri: "https://your-app.com/auth/callback",
});

Repository: github.com/Finsel-DGI/pasby-auth-react

Other languages

Use curl examples and the endpoint index until an official SDK exists for your stack.

LanguageStatus
PythonREST examples in quickstart
Go, PHP, Ruby, FlutterREST only

On this page