01 Add the script
There is no API key, publisher account, or server-side authentication to set up. Add the module and set the site name before it runs. A logo is optional.
<script>
window.AudioPassConfig = {
siteName: "Your Site",
siteLogo: "https://your.site/logo.png"
};
</script>
<script type="module" src="https://app.audiopass.app/audiopass.js"></script>
If you only want the app to load when a reader shows intent, import it from your own click handler instead:
let sdk = null;
function loadAudioPass() {
if (!sdk) {
window.AudioPassConfig = { siteName: "Your Site" };
sdk = import("https://app.audiopass.app/audiopass.js");
}
return sdk;
}
02 Open the sidebar
Call AudioPass.open() from any button. It opens the sidebar with no pending clip.
<button id="get-audiopass">Get AudioPass</button>
<script type="module">
document.querySelector("#get-audiopass").addEventListener("click", async () => {
await loadAudioPass();
AudioPass.open();
});
</script>
AudioPass.prefetch() loads the sidebar in the background without opening it. Use it on mouse hover or keyboard focus when you want the first open to feel instant. On touch, let the click create the iframe; inserting a fixed iframe on pointerdown can swallow the first tap on iOS.
03 Save a clip
Call AudioPass.save() with the page and the direct audio URL. The sidebar opens with the clip waiting; the reader signs in and saves it to a collection.
AudioPass.save({
title: "Episode title",
description: "One line about the audio.",
originUrl: location.href,
mediaUrl: "https://example.com/audio.mp3"
});
mediaUrl must be a direct audio URL. AudioPass stores the link and its metadata; it does not download or re-host the audio.
04 Premium status
The host page can style itself for members without polling and without loading the sidebar on every visit.
const status = await AudioPass.status();
if (status.paid) {
document.body.classList.add("is-member");
}
AudioPass.onStatus(({ paid }) => {
if (paid) document.body.classList.add("is-member");
else document.body.classList.remove("is-member");
});
if (AudioPass.getStatus().stale) {
AudioPass.refreshStatus(); // at most once, when the cache is stale
}
status() is safe to call on every page. It reads a short, signed status result from an edge-cached endpoint, so repeated visits do not touch the database or load the app. A first-time visitor has no status yet: call prefetch() once on intent, or wait for the sidebar to open. refreshStatus() renews a stale cached token and does nothing for a visitor who has never opened the sidebar.
Use this for cosmetics. Removing ads, showing a member badge, or changing an upsell. For gating paid content, contact us about a server-side integration.
05 Loading and privacy
- The SDK creates no iframe until
open(),save(), orprefetch(). - A page that includes the script but never opens the sidebar makes no iframe or session request; only the small SDK assets are fetched.
- The sidebar receives the page URL as the clip's origin. It does not read your page content.
- AudioPass keeps the link and metadata, never the audio file.
- The status result describes only paid and signed-in state. It does not expose an account.
Using a CSP or Permissions-Policy? Allow https://app.audiopass.app in script-src, frame-src, and connect-src, and allow storage-access. The SDK already sets allow="storage-access" on the iframe.
06 Browser support
Tested in current Chrome, Edge, Firefox, Safari, iOS Safari, Chrome Android, Firefox Android, and Samsung Internet. The sidebar needs ES modules, Shadow DOM, and fetch; passkeys additionally need WebAuthn, and the other sign-in methods stay available where passkeys are limited.
Older browsers degrade instead of breaking. The animated homepage demo is hidden when container queries are unavailable, translucent surfaces fall back to solid colors, and the sidebar does not depend on :has() or inert.
Browser privacy rules can expire cross-site storage access after about 30 days without interaction. One click inside the sidebar renews it. Embedded WebViews without the Storage Access API fall back to the top-level app.
07 Questions
Write to hello@audiopass.app. If you are integrating a publisher site, a paywall, or a member benefit, tell us what you are building and we will help with the right hook.