Skip to main content

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.)

Free until you publish

Scaffolding, building, and previewing cost nothingcreate-dig-app never mints, touches the chain, or spends. You spend a flat 100 DIG only when you publish a capsule with digstore deploy. Iterate for free, publish when it's ready.

The five templates

TemplateWhat you getOutput dirWallet wired
staticPlain HTML/CSS/JS — the lightest way to ship a site. The "build" just copies src/public/.public
vite-reactA React SPA built with Vite — the fast default for an app frontend.dist
next-staticNext.js exported to static files (output: 'export') — deployable as a capsule.out
nft-dropA wallet-connected NFT mint page (ChiaProvider + the canonical CHIP-0035 spend builder).distyes
dapp-window-chiaA dapp wired to the injected Chia wallet via ChiaProvider (window.chia → WalletConnect).distyes

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

OptionDescription
<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, --helpShow usage and the template list.
-v, --versionPrint 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 manifest digstore (and the DIG SDK adapters) read: output-dir, build-command, and the default remote. This is the single source of truth digstore deploy and 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-sdk from npm.
  • digstore new <template> — the Rust CLI front door. Best if you already have the digstore CLI installed; it scaffolds without Node and keeps you in one tool through digstore dev and digstore deploy.

Pick whichever fits your stack — both lead into the same free digstore devdigstore deploy loop.