Pandus SDK documentation
Install the SDK
Add the Pandus SDK with one script tag, confirm that the domain is yours, check that it works and set your Content Security Policy.
Updated:
Want to see the dashboard before you install anything? Open the live demo: a demo shop with 30 days of invented visitors, no sign-in.
1. Copy the snippet
In the dashboard, open your site, then SDK → Install. Copy the snippet with your site token and put it into the <head> of every page:
<script async src="https://pandus.online/embed.js" data-site="YOUR_SITE_TOKEN"></script>
The token identifies the site, not a secret: the SDK accepts data only from the domains you confirmed. If the site already has the older Pandus embed code for the “Report a barrier” button, keep it: it is the same snippet and starts the SDK as soon as your plan includes it.
Platform guides are on Platforms: WordPress and WooCommerce, Shopify, Google Tag Manager, Wix, Tilda, Webflow and any other site.
Install with npm
For apps built with a bundler, use the open-source npm package instead of the script tag. It adds the same loader once, does nothing on the server and keeps the consent rules.
npm install @pandus/sdk
import { init, consent } from '@pandus/sdk';
init({ site: 'YOUR_SITE_TOKEN' });
Pass the visitor's choice from your own banner:
consent({ analytics: true, recordings: false });
2. Confirm that the domain is yours
The SDK collects nothing until the domain is confirmed. Otherwise anyone could put your token on another site, or your token on theirs. Pick one way in SDK → Install:
| Way | What to add |
|---|---|
| Meta tag | <meta name="pandus-site-verification" content="CODE"> on the home page |
| File | /.well-known/pandus-verify.txt with the code |
| DNS | A TXT record pandus-site-verification=CODE on the domain |
| WordPress plugin | Connect the Pandus plugin with a token from the same account |
The SDK also checks the Origin of every request against the confirmed domain and the subdomains you list in the settings. If the proof disappears later, the site keeps working for 30 days and then stops collecting.
3. Check that it works
Open your site in a private window, accept the consent banner and visit two or three pages. SDK → Install shows “SDK works” after the first events arrive. Your own visits do not count while you are signed in to Pandus as staff, so test in a private window.
For a live view of every event from one device, open any page with ?pandus_debug=1: see Debugging.
Content Security Policy
If your site sends a CSP header, allow the Pandus script and the ingest service. The exact values for your site are shown in SDK → Install:
script-src https://pandus.online
connect-src https://pandus.online https://e.pandus.online
Single-page apps
The SDK follows page changes made through the History API (pushState, replaceState, the back button), so React, Vue, Next.js and similar apps get one page_view per route without extra code.
Performance
- The loader is about 5 KB gzip, loaded with
async; it never blocks rendering. - Modules load lazily: only those switched on, only after consent, and recordings only for the sampled sessions.
- Events go in batches with
sendBeaconorfetchwithkeepalive, in idle time. - Our end-to-end tests check that our code causes no long task over 50 ms and measure the effect on LCP, INP and CLS.
Remove the SDK
Delete the snippet, or switch the SDK off for the site in SDK → Settings. Stored data is deleted when its retention period ends, or at once from the same settings page.
The Pandus SDK and the scanner are automated checks, not a full audit, and not legal advice. The SDK changes nothing on your site and does not determine which visitors use assistive technology.