@miden-sdk/create-miden-turnkey-react
v1.14.0
Published
CLI to scaffold a React + Vite app with Miden Turnkey integration
Readme
@miden-sdk/create-miden-turnkey-react
CLI to scaffold a React + Vite app with Miden and Turnkey wallet integration.
Usage
yarn create @miden-sdk/miden-turnkey-react my-appOptions
--skip-install: Skip automatic dependency installation
yarn create @miden-sdk/miden-turnkey-react my-app --skip-installWhat's Included
The generated project includes:
- Vite - Fast build tool with HMR
- React 18/19 - UI library
- TypeScript - Type safety
- @miden-sdk/miden-sdk - Miden blockchain SDK
- @turnkey/react-wallet-kit - Turnkey wallet integration
- @miden-sdk/miden-turnkey - Miden + Turnkey integration layer
- @miden-sdk/miden-turnkey-react - React hook for Miden + Turnkey
Pre-configured Features
- WASM support for Miden SDK
- Buffer/process polyfills for browser
- TurnkeyProvider setup
- Basic authentication flow
- Miden client initialization
Getting Started
After creating your project:
Navigate to your project:
cd my-appCopy the environment template:
cp .env.example .envEdit
.envwith your Turnkey credentials:VITE_TURNKEY_ORGANIZATION_ID=your-organization-id(Optional) Customize Miden settings in
src/App.tsx:const midenConfig = { nodeUrl: "https://rpc.miden.io", transportUrl: "https://transport.miden.io", accountSeed: "my-unique-seed", storageMode: "public" as const, };Start the development server:
yarn dev
Environment Variables
| Variable | Description |
|----------|-------------|
| VITE_TURNKEY_ORGANIZATION_ID | Your Turnkey organization ID |
| VITE_TURNKEY_API_BASE_URL | Turnkey API URL (default: https://api.turnkey.com) |
Miden Configuration
Miden settings are configured directly in src/App.tsx for flexibility:
| Setting | Default | Description |
|---------|---------|-------------|
| nodeUrl | https://rpc.miden.io | Miden node RPC URL |
| transportUrl | https://transport.miden.io | Note transport service URL |
| accountSeed | miden-turnkey-demo | Seed for deterministic account generation |
| storageMode | public | Account storage mode (public or private) |
License
ISC
