🏡 Home 👈 Prev 👉 Next

Template structure

Notion-Paywall is a plug-n-play serverless Next.js boilerplate. It consists of two main parts.

  1. The frontend
  2. The backend (API routes):

Required plumbing

Notion token

Notion-Paywall uses the notion-client package. It uses the token_v2 cookie to talk to Notion’s backend and request your Notion content. To retrieve your personal token, you’ll need to sign into Notion.com via the browser — not the Mac/Windows/phone app!

Database

You’ll need a database connection to store your customers’ emails and their sign-in sessions. Notion-Paywall uses Prisma.io to abstract all user auth database operations away. It ships with a schema.prisma that connects to MongoDB but you can easily opt for MySQL, Postgres, and other vendors. If you’re new to this, setting up a MongoDB cluster is [super easy](https://www.mongodb.com/docs/atlas/cluster-tier/](https://www.mongodb.com/docs/atlas/cluster-tier/).

SMTP-capable email provider

Notion-Paywall sends emails through the nodemailer package so you’ll need an SMTP transporter. All major email players support this…

Stripe API keys + webhook secret

Notion-Paywall talks to your Stripe account via the publishable key from the frontend and the secret key from the backend. Stripe, in turns, talks to Notion-Paywall via webhooks which need to be verified to prevent malicious activity.

Optional plumbing

Slack