open-index/open-npm huggingface dataset:
npm package: @miden-sdk/create-miden-para-react
Description: Create a Vite react-ts app preconfigured with Miden + Para's Vite setup
Author: Miden Labs
Latest version: 0.14.0

# @miden-sdk/create-miden-para-react

`npm create @miden-sdk/miden-para-react@latest my-app` scaffolds the latest Vite `react-ts` starter, overwrites it with this repo's `vite.config.ts`, swaps in a Para + Miden-ready `App.tsx`, and adds the deps needed to run it out of the box. The scaffold always runs `create-vite` with `--yes --no-install` and pipes "no" to the install prompt to prevent upstream installs from overwriting the template before we patch it.

## What it does
- Runs `npm create vite@latest <target> -- --template react-ts` so you always start from the upstream default.
- Replaces `vite.config.ts` with the Para + Miden-friendly config (dedupe/exclude and WASM asset handling).
- Replaces `src/App.tsx` with a `ParaSignerProvider` + `MidenProvider` starter that reports wallet, account ID, and client readiness.
- Adds Para/Miden deps: `@miden-sdk/miden-para`, `@miden-sdk/react`, `@getpara/react-sdk-lite`, `@getpara/evm-wallet-connectors`, `@miden-sdk/miden-sdk`, plus dev plugins `vite-plugin-node-polyfills`, `vite-plugin-wasm`, and `vite-plugin-top-level-await`.
- Installs dependencies using your detected package manager (`pnpm`, `yarn`, `bun`, or falls back to `npm`); `create-vite` is invoked with `--yes --no-install` and auto-answers "no" to install prompts to avoid reverting the patched files.
- Writes `.npmrc` with `legacy-peer-deps=true` for peer dependency resolution.
- Adds `src/polyfills.ts` and injects it into `src/main.tsx` to provide `Buffer`/`process` in the browser.

## Usage
- Standard: `npm create @miden-sdk/miden-para-react@latest my-new-app`
- Skip install: add `--skip-install` if you want to install later.
- Set `VITE_PARA_API_KEY` in a `.env.local` (or similar) file so the generated `App.tsx` can initialize Para. **Production deployments require a Para production API key.**
- Recommended next steps: `cd my-new-app && npm install && npm run dev` (`.npmrc` opts into legacy peer deps so npm works).

Publish from this folder with `npm publish --access public` when you're ready. For local testing, run `node ./packages/create-miden-para-react/bin/create-miden-para-react.mjs my-app`.
npm package: @miden-sdk/miden-para
Description: Miden x Para Integration
Author: Miden Labs
Latest version: 0.14.0

# @miden-sdk/miden-para

[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/0xMiden/miden-para/blob/main/LICENSE)
[![test](https://github.com/0xMiden/miden-para/actions/workflows/test.yml/badge.svg)](https://github.com/0xMiden/miden-para/actions/workflows/test.yml)
[![build](https://github.com/0xMiden/miden-para/actions/workflows/build.yml/badge.svg)](https://github.com/0xMiden/miden-para/actions/workflows/build.yml)

This is the Miden x Para SDK integration. Below, you'll find instructions for local building and linking the library. If you're looking for React integration, see [Miden x Para x React](./packages/use-miden-para-react/README.md) (package `@miden-sdk/use-miden-para-react`). If you want to scaffold a fresh Vite `react-ts` app with our Vite config baked in, check [create-miden-para-react](./packages/create-miden-para-react/README.md) (package `@miden-sdk/create-miden-para-react`).

## Requirements

- **Yarn 1.22.22** (enforced via `packageManager` field)
- Node.js (compatible with your project)
- A Para API key. **Production deployments require a Para production API key**; use a non-prod key for local/dev.

This project uses Yarn 1.22.22. The version is locked in `package.json` and will be automatically enforced by modern package managers that support the `packageManager` field.

## Peer Dependencies

`@miden-sdk/miden-para` expects these packages to be provided by the consuming app. Install matching versions alongside this package to avoid duplicate copies:

- `@miden-sdk/miden-sdk@^0.13.0`
- `@getpara/web-sdk@2.0.0-alpha.73`

Example install:

```bash
yarn add @miden-sdk/miden-para @miden-sdk/miden-sdk@^0.13.0 @getpara/web-sdk@2.0.0-alpha.73
```

When creating a client with `storageMode` set to `private`, supply an `accountSeed`; the initializer will throw if it is missing so that private accounts remain recoverable.

## Installation

```bash
yarn install
```

## Building

```bash
yarn build
```

## Publishing to npm

1. Update the version in `package.json` (the published package is `@miden-sdk/miden-para`).
2. Authenticate with npm if needed: `npm login`.
3. Publish: `npm run publish`. The `prepack` hook rebuilds `dist/` and the `postpack` hook moves the generated tarball into `build/`.
4. (Optional) Inspect the packed artifact without publishing via `npm pack` and check `build/` for the resulting `miden-sdk-miden-para-<version>.tgz`.
npm package: @miden-sdk/use-miden-para-react
Description: React hook that wires Para accounts into a Miden client
Author: Miden Labs
Latest version: 0.14.0

# @miden-sdk/use-miden-para-react

React hook that wires Para accounts into a Miden client.

## Install

```bash
npm install @miden-sdk/use-miden-para-react
```

## Peer Dependencies

`@miden-sdk/use-miden-para-react` expects these packages to be provided by the consuming app. Install matching versions alongside this package to avoid duplicate copies:

- `@miden-sdk/miden-sdk@^0.13.0`
- `@getpara/react-sdk-lite@^2.2.0`
- `@miden-sdk/miden-para@^0.13.0`
- `react@^18.0.0 || ^19.0.0`

Example install:

```bash
yarn add @miden-sdk/use-miden-para-react @miden-sdk/miden-sdk@^0.13.0 @getpara/react-sdk-lite@^2.2.0 @miden-sdk/miden-para@^0.13.0 react@^18.0.0
```

## Usage

```tsx
import '@getpara/react-sdk-lite/styles.css';
import { ParaProvider, useAccount, useModal } from '@getpara/react-sdk-lite';
import { useParaMiden } from '@miden-sdk/use-miden-para-react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

const queryClient = new QueryClient();

function App() {
  return (
    <QueryClientProvider client={queryClient}>
      <ParaProvider
        paraClientConfig={{
          apiKey: import.meta.env.VITE_PARA_API_KEY,
        }}
        config={{ appName: 'Starter for MidenxPara' }}
      >
        <Content />
      </ParaProvider>
    </QueryClientProvider>
  );
}

function Content() {
  const { client, accountId, para } = useParaMiden('https://rpc.testnet.miden.io');
  const { isConnected } = useAccount();
  const { openModal } = useModal();

  return (
    <div>
      <button onClick={() => isConnected ? para.logout() : openModal?.()}>
        {isConnected ? 'Disconnect Para' : 'Connect with Para'}
      </button>
      {isConnected &&
        <>
          <p>Account: {accountId ?? '—'}</p>
          <p>Client ready: {client ? 'yes' : 'no'}</p>
        </>
      }
    </div>
  );
}
```

For production apps, you must use a Para **production** API key. Use a non-prod key for local/dev environments.

Pass a custom transaction confirmation step as the optional fourth argument if you want to show your own popup before Para signs:

```tsx
const confirmTx = async (summary) => {
  await openCustomModal(summary);
};

const { client } = useParaMiden(
  'https://rpc.testnet.miden.io',
  'public',
  {},
  true, // set to false to skip the built-in modal
  confirmTx
);
```

If you switch the hook to `storageMode` set to `private`, pass an `accountSeed` via the third argument so the underlying client can initialize; this is required for private accounts and the hook will throw if it is omitted.

## Build

```bash
npm run build
```

Outputs `dist/index.mjs`, `dist/index.cjs`, and `dist/index.d.ts`. Use `npm pack` to inspect the tarball before publishing.
npm package: @miden-sdk/vite-plugin
Description: Vite plugin for Miden dApps — WASM dedup, COOP/COEP headers, and gRPC-web proxy
Author: Miden Contributors
Latest version: 0.13.4

# @miden-sdk/vite-plugin

Vite plugin for Miden dApps. Automates WASM deduplication, cross-origin isolation headers, and gRPC-web proxy configuration.

## Installation

```bash
npm install @miden-sdk/vite-plugin --save-dev
# or
yarn add @miden-sdk/vite-plugin --dev
```

## Usage

```typescript
// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { midenVitePlugin } from "@miden-sdk/vite-plugin";

export default defineConfig({
  plugins: [
    midenVitePlugin(), // zero-config: all defaults
    react(),
  ],
});
```

### With Options

```typescript
midenVitePlugin({
  rpcProxyTarget: "https://rpc.testnet.miden.io", // default
  rpcProxyPath: "/rpc.Api",                        // default
  crossOriginIsolation: true,                      // default
  wasmPackages: ["@miden-sdk/miden-sdk"],           // default
});
```

## What It Does

| Config | Purpose |
|--------|---------|
| `resolve.alias` | Force single copy of WASM module (avoids class identity issues) |
| `resolve.dedupe` | Vite deduplication hint |
| `resolve.preserveSymlinks` | Monorepo/symlink support |
| `optimizeDeps.exclude` | Don't pre-bundle WASM packages |
| `server.headers` (COOP/COEP) | SharedArrayBuffer for WASM workers |
| `server.proxy` | gRPC-web CORS bypass in dev |
| `build.target: "esnext"` | Top-level await for WASM |
| `worker.format: "es"` | ES module workers for WASM |

## Options

### `wasmPackages`
- **Type:** `string[]`
- **Default:** `["@miden-sdk/miden-sdk"]`
- Packages to deduplicate and exclude from pre-bundling.

### `crossOriginIsolation`
- **Type:** `boolean`
- **Default:** `true`
- Adds `Cross-Origin-Opener-Policy` and `Cross-Origin-Embedder-Policy` headers to the dev server. Required for `SharedArrayBuffer` (used by WASM workers).

### `rpcProxyTarget`
- **Type:** `string | false`
- **Default:** `"https://rpc.testnet.miden.io"`
- gRPC-web proxy target URL for the dev server. Set to `false` to disable.

### `rpcProxyPath`
- **Type:** `string`
- **Default:** `"/rpc.Api"`
- Path prefix for gRPC-web proxy requests.

## Requirements

- Vite 5.x or 6.x

## License

MIT