Standalone

Install the default Paperwall wall with a single script tag.

The standalone embed adds one <script> tag to your pages and displays the default Paperwall wall on your articles. It requires no build step, no package installation, and no interface code.

1. Add the snippet

Generate the snippet in the portal under Configure your code → Add a script tag, then add it to your site's <head>, or anywhere that loads on every page.

<script
  src="https://assets.paperwall.io/paperwall-bootstrap-v1.4.min.js"
  integrity="sha256-Mq+/rNztnrQlvURnvOyXsMIzsPvI04ucG8ZyXKr8rpo="
  crossorigin="anonymous"
></script>

<script type="application/javascript">
  window.onload = () =>
    buildWall({
      mode: "live",
      wallType: "standalone",
      siteToken: "YOUR_SITE_TOKEN",
      articleFinder: {
        selector: "blog-post",       // id of your article element
        postUrls: [/\/posts\/.*/],   // regex for article pages
      },
    });
</script>

Use the generated snippet rather than the example above. It contains your site token, and its src and integrity values are pinned to a loader build that has been fetched and hashed. A mismatched integrity attribute prevents the browser from running the script, which leaves the page with no wall and no reporting.

Configuring articleFinder

Two values need to match your site:

  • postUrls — regular expressions matching your article URLs. Pages matching none of them are ignored.
  • selector — locates the article body. blog-post matches that element id; .blog-post matches that class.

Add excludeUrls if a single include pattern cannot avoid catching pages that are not articles:

articleFinder: {
  selector: "blog-post",
  postUrls: [/\/posts\/.*/],
  excludeUrls: [/\/posts\/draft-/, /\/posts\/index\/?$/],
}

excludeUrls is applied only to paths that postUrls has already matched, so it narrows the set rather than adding to it.

The snippet contains no theme block. The wall takes its publication name and logo from your Paperwall site settings, so they are configured in one place and need no placeholder values in your page.

To display something different from your site settings, add the block:

theme: {
  siteName: "Your Publication",
  siteLogo: "https://your-site.com/logo.png",
}

Both keys are optional and fall back independently, so you can override the logo alone and leave the name to the site record.

Full option list

See Integrations for every configuration key, including mode and wallType.

Framework notes

The snippet is plain HTML, so its location depends on your stack: app.html or a root layout for SvelteKit, public/index.html for a Vite React application. On Next.js, use next/script with strategy="afterInteractive" and call buildWall from onReady. The portal generates this variant.

2. Verify the installation

Select Verify in the site editor. Paperwall opens your domain with a ?paperwall-token=… parameter, which the snippet uses to confirm the installation. Your site then moves from VERIFYING to PREVIEW, and article management becomes available.

What the loader does

The tag you add is a small loader rather than the wall itself. It reads your configuration, asks the Paperwall API which bundle to serve for your wallType, and injects that bundle's JavaScript and CSS with integrity hashes. This distinction is useful when debugging: a page where nothing appears usually points to the loader or a content security policy, whereas a wall that renders incorrectly points to the bundle.

Troubleshooting

  • Nothing loads. Open the browser inspector and confirm the script is present and has executed. A 404 on the loader URL indicates the snippet has been edited.
  • A content security policy blocks the script. Add https://paperwall.io and https://assets.paperwall.io to your script-src directive.
  • No wall appears on an article. Either the URL matches no postUrls regular expression, or selector matches no element on the page. Both checks run before any network request, so the network tab will show no Paperwall activity.
  • A wall appears on pages that are not articles. The postUrls pattern is too broad. Add excludeUrls, or narrow the include pattern.