how it’s built/step 02 of 10

Start the app

A Next.js app, two packages, three settings.

Any framework works; the SDK reads files with fetch and has no opinions. This site uses Next.js, because @polis-pub/next adds the three things a Next.js site wants: cached reads, the webhook route and the comments component.

npx create-next-app@latest my-site --typescript --app --no-tailwind
cd my-site
npm install @polis-pub/sdk @polis-pub/next

Then three settings. Copy .env.example to .env.local for local work, and set the same values in Vercel later:

.env.examplesource ↗
# The polis site this website displays.
POLIS_SITE=https://vdibart.polis.pub
# This website's own origin (used to point links between posts here).
POLIS_DISPLAY=https://vdibart.com
# The secret polis gave you when you added the webhook (shown once). Server only.
POLIS_WEBHOOK_SECRET=
# A long random string you make (openssl rand -hex 32): lets you re-read everything
# without a post (curl -X POST -H "Authorization: Bearer <it>" <site>/polis/refresh).
# Unset, the route is closed (404).
POLIS_REFRESH_SECRET=

POLIS_SITE is the only one you need to start. The webhook secret comes in step 8, when you add the webhook.

Using an AI assistant? Point it at node_modules/@polis-pub/sdk/AGENTS.md first. It explains polis in five lines and the whole API in twenty, written for the assistant that's writing your code.

The dependencies this site uses beyond those two are its own choices: unified and friends to render markdown, and the fonts. None of them are polis's.

package.jsonsource ↗
{
  "name": "vdibart.com",
  "private": true,
  "description": "vdibart.com: a website built on a polis site (vdibart.polis.pub) with the polis SDK, and a tutorial for building your own.",
  "type": "module",
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "typecheck": "tsc --noEmit"
  },
  "dependencies": {
    "@polis-pub/next": "file:vendor/polis-pub-next-0.1.0.tgz",
    "@polis-pub/sdk": "file:vendor/polis-pub-sdk-0.1.0.tgz",
    "next": "16.4.6",
    "react": "19.3.1",
    "react-dom": "19.3.1",
    "rehype-raw": "7.0.0",
    "rehype-sanitize": "6.0.0",
    "rehype-slug": "6.0.0",
    "rehype-stringify": "10.0.1",
    "remark-gfm": "4.0.1",
    "remark-parse": "11.0.0",
    "remark-rehype": "11.1.2",
    "unified": "11.0.5"
  },
  "devDependencies": {
    "@types/node": "24.10.1",
    "@types/react": "19.3.3",
    "typescript": "5.9.3"
  },
  "overrides": {
    "@polis-pub/sdk": "$@polis-pub/sdk"
  },
  "engines": {
    "node": ">=20"
  }
}