snizu app create
Write a small app that works, on plain Node with nothing to install. It installs on a store, checks webhooks, answers on stores' addresses and verifies both kinds of App Bridge token.
Node 22+2 min read
Usage
snizu app create <dir> [--template node]Arguments and flags
<dir>pathrequiredWhere to write the app. A folder with apackage.jsonalready in it is refused. Its name becomes the package's name.--templatenodeThe app to start from.nodeis the only one, and the default.
It needs no sign-in: the app is written from files inside the CLI.
What it writes
server.jsEvery route, on Node's ownhttpmodule: the install, webhooks, the app proxy and the backends of an embedded page and a checkout block.lib/verify.jsEverything you have to check, written out so you can read it: webhook signatures, app proxy signatures, admin session tokens and checkout block tokens.test/verify.test.jsTests for each check, run withnpm teston Node's own test runner..env.exampleThe variables the server reads:CLIENT_ID,CLIENT_SECRET,APP_URL,ADMIN_URL,API_URL,PORT.package.jsonnpm run dev(Node's--watchwith.env) andnpm test. No dependencies.README.md, .gitignoreWhat's where, and.envkept out of git.
The routes
GET /auth/startSends a merchant to install the app. Thestateit sends is tied to their browser with a cookie.GET /auth/callbackChecks thestate, then swaps the code for a token at/admin/v1/oauth/token. The store is the one the token endpoint names, never the one in the address.POST /webhooksChecks theshop-signatureon the raw body before reading it. See Verify webhook signatures./proxy/*Answers/apps/<your handle>/*on stores' addresses, once the signature on the query checks out. Add its address asapp_proxyin your manifest.GET /api/meYour embedded page's backend: checks the admin session token from@snizu/app-bridge.GET /api/checkout-blockYour checkout block's backend: checks its token from@snizu/app-bridge/checkout.
Examples
$ snizu app create gift-wrap
✓ Wrote an app in /home/salma/gift-wrap.
Next: cd gift-wrap, then snizu app init to link it, then npm test and npm run dev.
$ cd gift-wrap
$ cp .env.example .env
$ npm testThen link the folder to an app with snizu app init, and put the client ID and secret from the developer console in .env.
Was this page helpful?
Updated 25 Nov 2026