create-pollar-app-patrickkish
v0.1.7
Published
Scaffold a Next.js app with Pollar wallet pre-wired
Downloads
103
Readme
create-pollar-app-patrickkish
Scaffold a Next.js 16 app with Pollar wallet already wired — login, balance, assets, send, receive, and transaction history via the official SDK.
Built for pollar-backoffice#2.
Quick start
The issue acceptance path is npx — it works for everyone regardless of which package manager you use in the generated app.
npx (primary — issue #2 flow)
npx create-pollar-app-patrickkish@latest my-pollar-app
cd my-pollar-app
# edit .env.local — set NEXT_PUBLIC_POLLAR_API_KEY=pub_testnet_...
npm run devNon-interactive:
npx create-pollar-app-patrickkish@latest my-pollar-app --yes --pm pnpm --network testnetUse --pm to pick the package manager for the new app (defaults to npm when invoked via npx).
pnpm (team preference)
pnpm dlx create-pollar-app-patrickkish@latest my-pollar-app
cd my-pollar-app
# edit .env.local — set NEXT_PUBLIC_POLLAR_API_KEY=pub_testnet_...
pnpm devNon-interactive:
pnpm dlx create-pollar-app-patrickkish@latest my-pollar-app -- --yes --pm pnpm --network testnetnpm
Equivalent to npx (no npx prefix needed):
npm create create-pollar-app-patrickkish@latest my-pollar-app
cd my-pollar-app
# edit .env.local
npm run devNon-interactive:
npm create create-pollar-app-patrickkish@latest my-pollar-app -- --yes --pm npm --network testnetyarn
yarn create create-pollar-app-patrickkish my-pollar-app
cd my-pollar-app
# edit .env.local
yarn devNon-interactive:
yarn create create-pollar-app-patrickkish my-pollar-app --yes --pm yarn --network testnetbun
bunx create-pollar-app-patrickkish@latest my-pollar-app
cd my-pollar-app
# edit .env.local
bun run devNon-interactive:
bunx create-pollar-app-patrickkish@latest my-pollar-app --yes --pm bun --network testnetWhat you get
The generated app includes:
- Next.js 16 App Router, React 19, TypeScript, Tailwind 4
@pollar/core@^0.9.0and@pollar/react@^0.9.0PollarProviderin the root layout- Login via Pollar's hosted modal (Google, email OTP, passkey, external wallets)
- Home screen actions that open SDK modals: balance, assets, send (USDC example), receive, history
.env.example, eslint, prettier, and a README with a Deploy to Vercel button
No backend and no secret keys — client-side only.
CLI flags
| Flag | Description |
|------|-------------|
| --yes / -y | Skip prompts (uses detected package manager + testnet) |
| --pm <npm\|pnpm\|yarn\|bun> | Package manager for installing the new app |
| --network <testnet\|mainnet> | Written to .env.local as NEXT_PUBLIC_POLLAR_NETWORK |
When you skip --pm, the CLI picks the manager that invoked it (pnpm dlx → pnpm, npm create → npm, etc.).
Environment variables
| Variable | Required | Description |
|----------|----------|-------------|
| NEXT_PUBLIC_POLLAR_API_KEY | Yes | Publishable key from dashboard.pollar.xyz (pub_testnet_...) |
| NEXT_PUBLIC_POLLAR_NETWORK | No | testnet (default) or mainnet |
Get a testnet key at dashboard.pollar.xyz → Configuration → API Keys.
Requirements
- Node.js 20+
- A Pollar publishable API key (free, self-serve)
Develop this package locally
git clone https://github.com/PatrickKish1/create-pollar-app-patrickkish.git
cd create-pollar-app-patrickkish
pnpm install
node bin/index.js my-test-app --yes --pm pnpmPublish to npm
This package must be public so reviewers and users can run npx / pnpm dlx without npm login:
npm publish --access publicDo not use --access private for this deliverable — a private package cannot be installed by maintainers testing issue #2.
A prepublishOnly script blocks publishing if node_modules exists inside template/.
License
MIT
