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.)
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. 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 dig:// read path — FREE, no chain, no spend
digstore deploy # publish a capsule when you're ready (the only step that spends 100 DIG)
digstore dev serves your build over the genuine dig:// 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.
What it writes
Every scaffolded project includes:
dig.toml— the committable project manifestdigstore(and the DIG SDK adapters) read:output-dir,build-command, and the defaultremote. This is the single source of truthdigstore deployand the GitHub deploy Action use.README.md— the develop → preview (free) → publish flow for that template.- a real app that
npm installs and builds to the template's output dir.
Two front doors: create-dig-app vs digstore new
There are two ways to scaffold the same templates, and they produce the same kind of project:
npm create dig-app(this page) — the JS front door. Best if you live in the npm/Node world: no separate install, it runs straight from npm and the wallet templates pull@dignetwork/dig-sdkfrom npm.digstore new <template>— the Rust CLI front door. Best if you already have thedigstoreCLI installed; it scaffolds without Node and keeps you in one tool throughdigstore devanddigstore deploy.
Pick whichever fits your stack — both lead into the same free digstore dev → digstore deploy loop.
Related
- Build a dapp on Chia — the end-to-end thread from scaffold to a deployed dapp
- Example gallery — clone a finished version of each template
- Quickstart — the shorter "ship a site" path, free to publish
- Deploy from GitHub Actions — push-to-deploy in CI
- Using window.chia — the in-page wallet the wallet templates target
- Project config & build-time values — the
dig.tomleach template writes - Concepts & glossary — capsule, store, the DIG SDK, and DIG payment defined