Installation

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

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

Package manager

npm install @pingocean/paspo-sdk
import { renderButton, 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 renderButton and 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.renderButton("#paspo-button", { /* options */ });
Paspo.signIn({ /* options */ });
Paspo.takeVerifier(state);
FileSizeWhen
https://paspo.id/sdk/paspo.min.js~15 KBProduction
https://paspo.id/sdk/paspo.js~25 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. The SDK itself makes no requests from your page: the Paspo window, FedCM and the app run on the Paspo and browser side.

TypeScript

Types are included. The main ones:

import type {
  PaspoSignInOptions,
  PaspoSignInResult,
  PaspoSignInError,
  PaspoScope,
  PaspoButtonOptions,
  PaspoButtonTheme,
  PaspoButton,
} 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 renderButton or 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).

PlatformHow sign-in runs
ComputerThe Paspo window (popup). If it's blocked, a full-page redirect
Google Chrome 141+, scope phone without emailThe browser's sign-in prompt (FedCM); on failure, the Paspo window. Other Chromium browsers (Yandex, Opera…) get the Paspo window right away
iOS, iPadOS, AndroidThe Paspo app, or the Paspo web page without it. Comes back to redirectUri in a new tab
Android WebViewA plain Paspo link instead of intent://: the app or the web page opens, depending on the WebView

More in Desktop, FedCM and phones.

Next steps