Scaffold an app
create-dig-app is the JS front door for starting a DIG project. One command writes a runnable starter — a real app, a dig.toml, and (for the wallet templates) the DIG SDK already wired in — then prints your next steps.
npm create dig-app@latest my-app -- --template vite-react
…or run it with no arguments for an interactive picker (it prompts for a name and a template):
npm create dig-app@latest
It needs Node 18+ and has no runtime dependencies. The -- is npm's argument separator — it forwards the flags to create-dig-app. (With npx create-dig-app or pnpm create dig-app you can drop it.)
Scaffolding, building, and previewing cost nothing — create-dig-app never mints, touches the chain, or spends. You pay the uniform capsule price in $DIG only when you publish a capsule with digstore deploy. Iterate for free, publish when it's ready.
The five templates
| Template | What you get | Output dir | Wallet wired |
|---|---|---|---|
static | Plain HTML/CSS/JS — the lightest way to ship a site. The "build" just copies src/ → public/. | public | — |
vite-react | A React SPA built with Vite — the fast default for an app frontend. | dist | — |
next-static | Next.js exported to static files (output: 'export') — deployable as a capsule. | out | — |
nft-drop | A wallet-connected NFT mint page (ChiaProvider + the canonical CHIP-0035 spend builder). | dist | yes |
dapp-window-chia | A dapp wired to the injected Chia wallet via ChiaProvider (window.chia → WalletConnect). | dist | yes |
The two wallet templates (nft-drop, dapp-window-chia) wire in @dignetwork/dig-sdk: ChiaProvider prefers the injected DIG Browser wallet (window.chia) and falls back to WalletConnect → Sage, so you write the wallet flow once and it works everywhere. NFT minting uses the SDK's /spend builder — spends are never hand-rolled. To charge for access or gate it on an NFT, the SDK's Paywall helper composes the same provider with the spend builder. Nothing is minted, signed, or spent at scaffold time; minting is an explicit, wallet-signed action a user triggers later.
Options
| Option | Description |
|---|---|
<name> | Project directory + npm package name (slugified to be npm-safe). |
-t, --template <t> | One of: static, vite-react, next-static, nft-drop, dapp-window-chia. |
-h, --help | Show usage and the template list. |
-v, --version | Print the version. |
The free-until-publish flow
Scaffold, preview for free, then publish a capsule only when you're ready:
npm create dig-app@latest my-app -- --template vite-react
cd my-app
npm install
npm run dev # work on your app locally (skip for the static template)
digstore dev # preview on the real chia:// read path — FREE, no chain, no spend
digstore deploy # publish a capsule when you're ready (the only step that spends $DIG)
digstore dev serves your build over the genuine chia:// read path (compile → verify → decrypt) with live reload — it's exactly what visitors get, with zero chain interaction. You only spend when you run digstore deploy (or publish from DIGHUb). See the Quickstart for the full publish flow, and On-chain anchoring for wallet setup and costs.