Three install paths, from a single script tag to full ad gating around your existing bootstrap. Pick the shallowest one that does what you need.
Never expose the publisher API key in browser code. Publisher tokens are minted by your own server-side endpoint; the browser only ever holds short-lived tokens.
Load /sdk/paywall-ads.js, initialize it, mark your ad slots, then wrap your existing ad bootstrap in gateAds. Readers who paid get the reduced-ads experience their entitlement specifies.
<script src="https://dropcap-admin.pages.dev/sdk/paywall-ads.js"></script>
<script>
Paywall.init({
apiBase: "https://your-api.workers.dev",
getAccessToken: () => readerJwt, // your reader session
getPublisherToken: () => fetchPubToken(), // minted server-side
contentId: "ARTICLE_ID"
});
// mark slots in markup: <div data-paywall-ad="leaderboard"></div>
Paywall.gateAds({
onNoAds: () => {}, // skip the bootstrap
onMinimalAds: () => bootstrapAds({ cap: 1 }),
onStandardAds: () => bootstrapAds()
});
</script>
Wrap your GPT calls with gateDisplay and gateRefresh.
Wrap your auction with gateRequestBids.
<script src="https://dropcap-admin.pages.dev/sdk/paywall-embed.js"
data-site-key="site_xxx"
data-api-base="https://your-api.workers.dev"
data-placement="below_article"
data-content-id="ARTICLE_ID"></script>
<div data-paywall-article></div>
<script src="https://dropcap-admin.pages.dev/sdk/paywall-article.js"></script>
The article renders inside your shell, in your sitemap, with the required disclosure label.
paywall-consent.js ships a themeable, focus-trapped dialog with ARIA wiring and every string overridable, so consent copy stays yours and your legal team’s.
Verify signed entitlements in your own apps: PaywallAds.swift, PaywallAds.kt and paywall_ads.dart. Ad-free is enforceable here, unlike on the open web.
Everything the dashboard does, over HTTP — with auto-generated OpenAPI 3.1 specs and Postman collections so your client is a codegen step away.
Access and ad-tier decisions are JWS-signed and verifiable against a published JWKS, so your edge worker can decide without a round trip.