Installation

Install the Paspo Web SDK from npm or load it from the CDN.

The SDK is one small file with no dependencies: ~5.6 KB minified, ~2.4 KB gzipped. Pick a package manager, or load it with a <script> tag.

Package manager

npm install @pingocean/paspo-sdk
import { signIn, takeVerifier, takeNonce } from "@pingocean/paspo-sdk";

The package ships ESM, CommonJS and TypeScript types. It touches no browser globals at import time, so it is safe to import in SSR code (Next.js, Nuxt, SvelteKit, Angular Universal); only signIn must run in the browser.

CDN

No bundler? Add the script tag. It exposes window.Paspo with the same functions.

<script src="https://paspo.id/sdk/paspo.min.js" defer></script>
Paspo.signIn({ /* options */ });
Paspo.takeVerifier(state);
FileSizeWhen
https://paspo.id/sdk/paspo.min.js~5.6 KBProduction
https://paspo.id/sdk/paspo.js~11 KBDebugging, readable source

The script detects the Paspo origin from its own src, so a copy loaded from a staging host talks to that host. Don't self-host or bundle the CDN file: you'd miss fixes. For pinned versions use the npm package.

Content Security Policy

If your site sends a CSP header, allow script-src https://paspo.id (CDN build only) and connect-src https://paspo.id (discovery request).

TypeScript

Types are included. The main ones:

import type {
  PaspoSignInOptions,
  PaspoSignInResult,
  PaspoSignInError,
  PaspoScope,
} from "@pingocean/paspo-sdk";

With the CDN build, window.Paspo is typed once you import the package types anywhere, e.g. in a paspo.d.ts:

paspo.d.ts
import "@pingocean/paspo-sdk";

Staging / custom origin

The npm build talks to https://paspo.id. To point it elsewhere, call configure once before the first signIn:

import { configure } from "@pingocean/paspo-sdk";

configure({ origin: "https://staging.paspo.id" });

Browser support

All evergreen browsers: Chrome, Edge, Firefox, Safari 14+, and their mobile versions. The SDK needs Web Crypto (crypto.subtle), which is available only in secure contexts — serve your page over HTTPS (or http://localhost in development).

The FedCM prompt is used in Chromium 141+ when you request phone without email. Everywhere else the SDK opens the Paspo window.

Next steps