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.
npm install @pingocean/paspo-sdk
pnpm add @pingocean/paspo-sdk
yarn add @pingocean/paspo-sdk
bun add @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.
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);
| File | Size | When |
|---|---|---|
https://paspo.id/sdk/paspo.min.js | ~5.6 KB | Production |
https://paspo.id/sdk/paspo.js | ~11 KB | Debugging, 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.
If your site sends a CSP header, allow script-src https://paspo.id (CDN build only) and connect-src https://paspo.id (discovery request).
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:
import "@pingocean/paspo-sdk";
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" });
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.