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.
npm install @pingocean/paspo-sdk
pnpm add @pingocean/paspo-sdk
yarn add @pingocean/paspo-sdk
bun add @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.
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);
| File | Size | When |
|---|---|---|
https://paspo.id/sdk/paspo.min.js | ~15 KB | Production |
https://paspo.id/sdk/paspo.js | ~25 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. The SDK itself makes no requests from your page: the Paspo window, FedCM and the app run on the Paspo and browser side.
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:
import "@pingocean/paspo-sdk";
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" });
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).
| Platform | How sign-in runs |
|---|---|
| Computer | The Paspo window (popup). If it's blocked, a full-page redirect |
Google Chrome 141+, scope phone without email | The browser's sign-in prompt (FedCM); on failure, the Paspo window. Other Chromium browsers (Yandex, Opera…) get the Paspo window right away |
| iOS, iPadOS, Android | The Paspo app, or the Paspo web page without it. Comes back to redirectUri in a new tab |
| Android WebView | A plain Paspo link instead of intent://: the app or the web page opens, depending on the WebView |
More in Desktop, FedCM and phones.