### Install dependencies and run examples
Source: https://github.com/rainbow-me/rainbowkit/blob/main/README.md
Commands to install dependencies and start the development server for an example project.
```bash
pnpm install
```
```bash
cd examples/with-next
```
```bash
pnpm run dev
```
--------------------------------
### Run Development Server
Source: https://github.com/rainbow-me/rainbowkit/blob/main/AGENTS.md
Starts the example application and the documentation site simultaneously. Both will be accessible via localhost.
```bash
pnpm dev # Run example app + site (localhost:3000 and :3001)
```
--------------------------------
### Run Library and Example App
Source: https://github.com/rainbow-me/rainbowkit/blob/main/AGENTS.md
Starts the development server for the library packages and the example application. Does not include the documentation site.
```bash
pnpm dev:example # Run lib + example app only
```
--------------------------------
### Start Development Servers
Source: https://github.com/rainbow-me/rainbowkit/blob/main/AGENTS.md
Commands to start the development servers for the example app and the documentation site. Library watch-mode is included.
```bash
pnpm dev:example
```
```bash
pnpm dev:site
```
```bash
pnpm dev
```
--------------------------------
### Run Library and Documentation Site
Source: https://github.com/rainbow-me/rainbowkit/blob/main/AGENTS.md
Starts the development server for the library packages and the documentation site. Does not include the example application.
```bash
pnpm dev:site # Run lib + docs site only
```
--------------------------------
### Install Dependencies
Source: https://github.com/rainbow-me/rainbowkit/blob/main/AGENTS.md
Installs all project dependencies and generates type definitions from the root of the monorepo. This is the initial setup command.
```bash
pnpm install # Install dependencies and generate type definitions from root
```
--------------------------------
### Install dependencies
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-react-router/README.md
Run this command to install all required project dependencies.
```bash
npm install
```
--------------------------------
### Install Dependencies
Source: https://github.com/rainbow-me/rainbowkit/blob/main/packages/rainbowkit-siwe-next-auth/README.md
Install the necessary packages for RainbowKit SIWE NextAuth integration and NextAuth v5.
```bash
npm install @rainbow-me/rainbowkit-siwe-next-auth next-auth@5.0.0-beta.31
```
--------------------------------
### Custom Wallet Example
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/en-US/docs/custom-wallets.mdx
Example of creating a custom wallet using RainbowKit and WalletConnect.
```APIDOC
## POST /api/custom-wallet
### Description
This endpoint demonstrates how to create and configure a custom wallet for integration with RainbowKit, leveraging WalletConnect for mobile and extension connections.
### Method
POST
### Endpoint
/api/custom-wallet
### Parameters
#### Request Body
- **projectId** (string) - Required - Project ID for WalletConnect
### Request Example
```json
{
"projectId": "YOUR_PROJECT_ID"
}
```
### Response
#### Success Response (200)
- **wallet** (object) - The configured custom wallet object.
- **id** (string) - Unique identifier for the wallet.
- **name** (string) - Display name of the wallet.
- **iconUrl** (string) - URL for the wallet's icon.
- **iconBackground** (string) - Background color for the wallet icon.
- **downloadUrls** (object) - URLs for downloading the wallet on different platforms.
- **android** (string) - Optional - Google Play URL.
- **ios** (string) - Optional - Apple App Store URL.
- **chrome** (string) - Optional - Chrome Web Store URL.
- **qrCode** (string) - Optional - URL for QR code scanning.
- **mobile** (object) - Configuration for mobile connections.
- **getUri** (function) - Function to get the connection URI.
- **qrCode** (object) - Configuration for QR code connections.
- **getUri** (function) - Function to get the connection URI.
- **instructions** (object) - Instructions for QR code connection.
- **learnMoreUrl** (string) - URL for more information.
- **steps** (array) - Array of steps for the user.
- **extension** (object) - Configuration for browser extension connections.
- **instructions** (object) - Instructions for extension connection.
- **learnMoreUrl** (string) - URL for more information.
- **steps** (array) - Array of steps for the user.
- **createConnector** (function) - Function to create the wallet connector.
#### Response Example
```json
{
"wallet": {
"id": "my-wallet",
"name": "My Wallet",
"iconUrl": "https://my-image.xyz",
"iconBackground": "#0c2f78",
"downloadUrls": {
"android": "https://play.google.com/store/apps/details?id=my.wallet",
"ios": "https://apps.apple.com/us/app/my-wallet",
"chrome": "https://chrome.google.com/webstore/detail/my-wallet",
"qrCode": "https://my-wallet/qr"
},
"mobile": {
"getUri": "(uri: string) => uri"
},
"qrCode": {
"getUri": "(uri: string) => uri",
"instructions": {
"learnMoreUrl": "https://my-wallet/learn-more",
"steps": [
{
"description": "We recommend putting My Wallet on your home screen for faster access to your wallet.",
"step": "install",
"title": "Open the My Wallet app"
},
{
"description": "After you scan, a connection prompt will appear for you to connect your wallet.",
"step": "scan",
"title": "Tap the scan button"
}
]
}
},
"extension": {
"instructions": {
"learnMoreUrl": "https://my-wallet/learn-more",
"steps": [
{
"description": "We recommend pinning My Wallet to your taskbar for quicker access to your wallet.",
"step": "install",
"title": "Install the My Wallet extension"
},
{
"description": "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.",
"step": "create",
"title": "Create or Import a Wallet"
},
{
"description": "Once you set up your wallet, click below to refresh the browser and load up the extension.",
"step": "refresh",
"title": "Refresh your browser"
}
]
}
},
"createConnector": "getWalletConnectConnector({ projectId })"
}
}
```
```
--------------------------------
### Install Foundry and Dependencies
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/lib/openzeppelin-contracts/lib/erc4626-tests/README.md
Commands to install the Foundry toolchain and add the necessary forge-std library to your project.
```bash
$ curl -L https://foundry.paradigm.xyz | bash
$ cd /path/to/your-erc4626-vault
$ forge install foundry-rs/forge-std
```
--------------------------------
### Install RainbowKit and Dependencies
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/en-US/docs/installation.mdx
Install RainbowKit and its peer dependencies, wagmi, viem, and @tanstack/react-query, using npm.
```bash
npm install @rainbow-me/rainbowkit wagmi viem@2.x @tanstack/react-query
```
--------------------------------
### Install Forge Standard Library
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/lib/forge-std/README.md
Command to install the library via the Forge CLI.
```bash
forge install foundry-rs/forge-std
```
--------------------------------
### Run Development Server with npm
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-rainbow-button/README.md
Use this command to start the Next.js development server using npm.
```bash
npm run dev
```
--------------------------------
### Install OpenZeppelin Contracts with npm
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/lib/openzeppelin-contracts/README.md
Use this command to install the OpenZeppelin Contracts library for use with Hardhat.
```bash
$ npm install @openzeppelin/contracts
```
--------------------------------
### Upgrade Dependencies
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/zh-CN/guides/next-auth-v5.mdx
Install the supported versions of NextAuth v5 and the RainbowKit SIWE NextAuth adapter.
```bash
npm install next-auth@5.0.0-beta.31 @rainbow-me/rainbowkit-siwe-next-auth
```
--------------------------------
### Upgrade dependencies
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/en-US/docs/migration-guide.mdx
Install the latest versions of RainbowKit, wagmi, and viem.
```bash
npm i @rainbow-me/rainbowkit@2 wagmi@2 viem@2.x
```
--------------------------------
### Run Development Servers
Source: https://github.com/rainbow-me/rainbowkit/blob/main/CLAUDE.md
Commands to run the example app and documentation site simultaneously or individually. Use `pnpm dev:lib` to watch and rebuild library packages.
```bash
pnpm dev
```
```bash
pnpm dev:lib
```
```bash
pnpm dev:example
```
```bash
pnpm dev:site
```
```bash
pnpm dev:cli
```
```bash
pnpm dev:template:next-app
```
--------------------------------
### Install Rainbow Button and Dependencies
Source: https://github.com/rainbow-me/rainbowkit/blob/main/packages/rainbow-button/README.md
Install the `@rainbow-me/rainbow-button` package along with its peer dependencies: wagmi, viem, and @tanstack/react-query. Ensure viem is version 2.x.
```bash
npm install @rainbow-me/rainbow-button wagmi viem@2.x @tanstack/react-query
```
--------------------------------
### Scaffold Template and Start Dev Server
Source: https://github.com/rainbow-me/rainbowkit/blob/main/AGENTS.md
Scaffolds a template application using the CLI and then starts a development server. This is a comprehensive test of the CLI's functionality.
```bash
pnpm test:cli:dev # Scaffold template + start dev server
```
--------------------------------
### Run Development Server
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-app/README.md
Use npm or yarn to start the development server for the Next.js project. Open the provided URL in your browser to view the application.
```bash
npm run dev
# or
yarn dev
```
--------------------------------
### Start Local Node with Anvil
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/README.md
Launches a local Ethereum development node.
```shell
$ anvil
```
--------------------------------
### Install RainbowKit with npm
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/public/llms-full.txt
Use this command to scaffold a new RainbowKit + wagmi + Next.js app with npm.
```bash
npm init @rainbow-me/rainbowkit@latest
```
--------------------------------
### Initialize New RainbowKit Project
Source: https://github.com/rainbow-me/rainbowkit/blob/main/packages/create-rainbowkit/README.md
Use one of the following commands to scaffold a new RainbowKit project. This command installs the latest version of RainbowKit and sets up a basic project structure.
```bash
npm init @rainbow-me/rainbowkit@latest
```
```bash
pnpm create @rainbow-me/rainbowkit@latest
```
```bash
yarn create @rainbow-me/rainbowkit
```
--------------------------------
### Install viem dependency
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/es-419/docs/migration-guide.mdx
wagmi v1 requires the `viem` dependency. Install it using npm.
```bash
npm i viem
```
--------------------------------
### Run Development Server with Yarn
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-rainbow-button/README.md
Use this command to start the Next.js development server using yarn.
```bash
yarn dev
```
--------------------------------
### Install Dependencies for RainbowKit v2
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/en-US/guides/rainbowkit-wagmi-v2.mdx
Use npm to install the latest versions of RainbowKit, wagmi, and viem v2.x.
```bash
npm i @rainbow-me/rainbowkit wagmi viem@2.x
```
--------------------------------
### Install Dependencies for Wagmi v1
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/en-US/docs/migration-guide.mdx
Commands to upgrade RainbowKit and Wagmi, and install the required viem peer dependency.
```bash
npm i @rainbow-me/rainbowkit@^1 wagmi@^1
```
```bash
npm i viem
```
--------------------------------
### Install RainbowKit with pnpm
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/public/llms-full.txt
Use this command to scaffold a new RainbowKit + wagmi + Next.js app with pnpm.
```bash
pnpm create @rainbow-me/rainbowkit@latest
```
--------------------------------
### Install Dependencies with pnpm
Source: https://github.com/rainbow-me/rainbowkit/blob/main/CLAUDE.md
Use this command to install all project dependencies and generate type definitions from the root of the monorepo.
```bash
pnpm install
```
--------------------------------
### Install OpenZeppelin Contracts with Forge
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/lib/openzeppelin-contracts/README.md
Use this command to install the OpenZeppelin Contracts library for use with Foundry. Ensure you use a tagged release and not the master branch. Add the remapping in remappings.txt.
```bash
$ forge install OpenZeppelin/openzeppelin-contracts
Add @openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ in remappings.txt.
```
--------------------------------
### Install Halmos Cheatcodes with Foundry
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/lib/openzeppelin-contracts/lib/halmos-cheatcodes/README.md
Use this command to install the Halmos cheatcodes library using Foundry.
```bash
forge install a16z/halmos-cheatcodes
```
--------------------------------
### Start Remix Production Server
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-remix/README.md
After building for production, use this command to run your Remix application in production mode.
```sh
npm start
```
--------------------------------
### Create New RainbowKit Project
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/public/llms-full.txt
Use this command to generate a new boilerplate project with RainbowKit pre-configured. It prompts for a project name and installs dependencies.
```bash
yarn create @rainbow-me/rainbowkit
```
--------------------------------
### Remix Build Tooling Setup
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/en-US/docs/installation.mdx
Configure Remix to polyfill buffer, events, and http modules for compatibility with RainbowKit and other Node.js built-ins.
```ts
/** @type {import('@remix-run/dev').AppConfig} */
export default {
ignoredRouteFiles: ["**/.*"],
browserNodeBuiltinsPolyfill: {
modules: { buffer: true, events: true, http: true },
},
};
```
--------------------------------
### Upgrade RainbowKit and Wagmi dependencies
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/en-US/guides/walletconnect-v2.mdx
Install the latest versions of RainbowKit and Wagmi to enable WalletConnect v2 support.
```bash
npm i @rainbow-me/rainbowkit@^1.0.2 wagmi@^1.2
```
--------------------------------
### Import RainbowKit and Wagmi Components
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/en-US/docs/installation.mdx
Import necessary styles and components from RainbowKit, wagmi, and @tanstack/react-query for application setup.
```tsx
import '@rainbow-me/rainbowkit/styles.css';
import {
getDefaultConfig,
RainbowKitProvider,
} from '@rainbow-me/rainbowkit';
import { WagmiProvider } from 'wagmi';
import {
mainnet,
polygon,
optimism,
arbitrum,
base,
} from 'wagmi/chains';
import {
QueryClientProvider,
QueryClient,
} from "@tanstack/react-query";
```
--------------------------------
### Next.js Build Tooling Setup
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/en-US/docs/installation.mdx
Configure Next.js scripts to use the webpack bundler by adding the --webpack flag, necessary for certain plugins.
```json
{
"scripts": {
"dev": "next dev --webpack",
"build": "next build --webpack"
}
}
```
--------------------------------
### Scaffold a new RainbowKit project
Source: https://github.com/rainbow-me/rainbowkit/blob/main/README.md
Initialize a new project using the preferred package manager.
```bash
npm init @rainbow-me/rainbowkit@latest
# or
pnpm create @rainbow-me/rainbowkit@latest
# or
yarn create @rainbow-me/rainbowkit
```
--------------------------------
### Install TanStack Query Peer Dependency
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/data/en-US/guides/rainbowkit-wagmi-v2.mdx
Install `@tanstack/react-query` as it is now a required peer dependency for Wagmi v2.
```bash
npm i @tanstack/react-query
```
--------------------------------
### Set up Node.js Version with NVM
Source: https://github.com/rainbow-me/rainbowkit/blob/main/CLAUDE.md
Sources NVM and selects Node.js version 24, required for development within the repository.
```bash
export NVM_DIR="$HOME/.nvm" && source "$NVM_DIR/nvm.sh"
nvm use 24
```
--------------------------------
### Create New Remix Project and Copy App Folder
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-remix/README.md
This sequence of commands demonstrates how to create a new Remix project, potentially with pre-configured hosting, and then replace its default 'app' folder with your existing project's 'app' folder.
```sh
cd ..
# create a new project, and pick a pre-configured host
npx create-remix@latest
cd my-new-remix-app
# remove the new project's app (not the old one!)
rm -rf app
# copy your app over
cp -R ../my-old-remix-app/app app
```
--------------------------------
### Access Help Documentation
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/README.md
Displays help information for Foundry CLI tools.
```shell
$ forge --help
$ anvil --help
$ cast --help
```
--------------------------------
### View Certora Make Help
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/lib/openzeppelin-contracts/certora/README.md
Display available make commands for the Certora verification process.
```bash
make -C certora help
```
--------------------------------
### Prefix Interface Names with I
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/lib/openzeppelin-contracts/GUIDELINES.md
All interface definitions must start with a capital I.
```solidity
interface IERC777 {
```
--------------------------------
### Defining Struct Depth for stdStorage
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/lib/forge-std/README.md
Example of struct field depth mapping for use with stdStorage.
```solidity
struct T {
// depth 0
uint256 a;
// depth 1
uint256 b;
}
```
--------------------------------
### Extend ERC4626Test Contract
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/lib/openzeppelin-contracts/lib/erc4626-tests/README.md
Example implementation of the abstract ERC4626Test contract to configure vault parameters for testing.
```solidity
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.0 <0.9.0;
import "erc4626-tests/ERC4626.test.sol";
import { ERC20Mock } from "/path/to/mocks/ERC20Mock.sol";
import { ERC4626Mock } from "/path/to/mocks/ERC4626Mock.sol";
contract ERC4626StdTest is ERC4626Test {
function setUp() public override {
_underlying_ = address(new ERC20Mock("Mock ERC20", "MERC20", 18));
_vault_ = address(new ERC4626Mock(ERC20Mock(__underlying__), "Mock ERC4626", "MERC4626"));
_delta_ = 0;
_vaultMayBeEmpty = false;
_unlimitedAmount = false;
}
}
```
--------------------------------
### Build for production
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-react-router/README.md
Generates a production-ready build of the application.
```bash
npm run build
```
--------------------------------
### Source NVM and Enable pnpm
Source: https://github.com/rainbow-me/rainbowkit/blob/main/AGENTS.md
Commands to set up the Node.js environment using nvm and enable pnpm. This is crucial for Cursor Cloud specific instructions.
```bash
export NVM_DIR="$HOME/.nvm" && source "$NVM_DIR/nvm.sh"
```
```bash
corepack enable pnpm
```
--------------------------------
### Install ERC4626 Test Suite
Source: https://github.com/rainbow-me/rainbowkit/blob/main/examples/with-next-mint-nft/contract/lib/openzeppelin-contracts/lib/erc4626-tests/README.md
Command to add the a16z ERC4626 test suite as a dependency to your vault repository.
```bash
$ cd /path/to/your-erc4626-vault
$ forge install a16z/erc4626-tests
```
--------------------------------
### Wrap Application with Providers
Source: https://github.com/rainbow-me/rainbowkit/blob/main/site/public/llms-full.txt
Wrap your application's root component with WagmiProvider, QueryClientProvider, and RainbowKitProvider to enable wallet connection functionality.
```javascript
const queryClient = new QueryClient();
const App = () => {
return (