nano133Next.js

Nano Unlock · a free package for Next.js

Sell part of a page for 1¢.
No database.

Lock the second half of an article, a recipe or a download. Readers pay a few cents in Nano straight to your own wallet. Your site checks each payment itself at a Nano node: no account, no card, no middleman, no key on your server.

  • MIT
  • Next.js 15 and 16
  • App Router
  • Vercel and Cloudflare Workers
  • No custody

Two files. Two settings.

app/api/unlock/[action]/route.ts

import { handlers } from "@nano133/unlock/next";

export const { GET, POST } = handlers();

The route that starts a payment and asks the node if it arrived.

Your article's page (a server component)

import { Unlock, unlocked } from "@nano133/unlock/next";

export default async function Page() {
  return (
    <article>
      <p>The free part.</p>
      {(await unlocked("post-1"))
        ? <PaidPart />
        : <Unlock item="post-1" price={0.01} />}
    </article>
  );
}

The paid part is rendered on your server only, for a reader who paid. It is not in the page before that.

For site owners

Five steps, about five minutes

  1. Install the package.
  2. Add the route.One file with two lines, as above.
  3. Set two settings.Your Nano address and a secret.
    What they are

    The address is your own, from your wallet's Receive screen. The secret is a long random text that only your site knows.

  4. Lock a part.Give it a name and a price, from 1¢ to $1000.
    What readers see

    The price and an Unlock button. The paid part is not in the page before a payment.

  5. Deploy.No database and no account to set up.
    A wrong setting

    With a setting absent or wrong, the button does not show, so nobody can pay a wrong address.

No site yet? Deploy the blog: the button copies a small blog with one free article and two paid ones into your own account, and asks for the two settings.

How a payment is checked

Your site asks the Nano network

  1. The reader presses Unlock.The page shows a QR code and a wallet button.
    An exact amount for each reader

    The price in Nano plus a tiny random tail, far below a cent. The amount tells one payment from every other, so one address serves all readers.

  2. The wallet sends.Straight to your address.
    Why not a typed amount

    The QR code and “Open in wallet” fill in the exact amount. A typed amount or an exchange cannot send it.

  3. Your site asks a Nano node.The node decides, not the browser.
    What counts

    A confirmed send of exactly that amount to your address, first seen after the reader pressed Unlock. If the node does not answer, nothing opens.

    15 minutes, then 24 hours

    The page shows the QR code and the wallet button for 15 minutes and asks every 5 seconds. A payment still counts for 24 hours.

  4. The part opens.The browser keeps a signed pass for 30 days.
    What your site stores

    Nothing about the reader. The pass is in the reader's browser.

Limits to know8
  • No list of salesThe site stores nothing.

    Your wallet's history is the record of who paid what.

  • A payment with no unlockIt can happen. You settle it by hand.

    A payment later than 24 hours, a wrong amount, or a browser that lost its cookies. The package holds no key, so it cannot send money back. You see every payment in your wallet.

  • One browserA pass is a cookie of one browser.

    There is no pass for a second device in this version, and a person who copies the cookie has the same access.

  • No true rate limitThe package's own limits are best-effort.

    A site on Vercel or on Cloudflare Workers has no shared count of requests. Use your host's rate limit if you need a true one.

  • Our node is the defaultIts answers decide what your site unlocks.

    The package asks node.nano133.com unless you set your own node. You can also set a second node that must agree.

  • On Cloudflare WorkersIt runs there too, with version 0.1.1 or newer and Next.js 16.3.8.

    Nano Unlock on Cloudflare Workers. Our node counts a Worker by its Cloudflare zone: about 120 calls a minute for one site, which serves about 5 readers who pay at the same moment, and 1,200 a minute for all Workers together. A busy site sets its own node.

  • SubscriptionsEach unlock is one payment.

    Nano has no pull payments: a wallet sends, and nothing takes.

  • Next.js Pages RouterThis version is for the App Router only.

    A site on the Pages Router cannot use it yet.

Start with the blog, or with your own site

The package is free and open source. It is new: read the limits first, and start with small prices.

The live demo is the same blog with our own address in it: its Unlock button takes a real payment of about 1 cent in Nano, and you can look at it without a payment. The same blog also runs as a Cloudflare Worker, with a real payment too. “Deploy the blog to Vercel” opens Vercel, and “Deploy it to Cloudflare” opens Cloudflare: hosting companies that we do not run. You need an account there and a Git account. nano133 is not a part of Vercel or Cloudflare and is not endorsed by them. Next.js and Vercel are trademarks of Vercel, Inc. Cloudflare is a trademark of Cloudflare, Inc. On WordPress? The same idea as a plugin.