Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference
version: 2.1

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs
jobs:
say-hello:
# Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job
docker:
# Specify the version you desire here
# See: https://circleci.com/developer/images/image/cimg/base
- image: cimg/base:current

# Add steps to the job
# See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps
steps:
# Checkout the code as the first step.
- checkout
- run:
name: "Say hello"
command: "echo Hello, World!"

# Orchestrate jobs using workflows
# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows
workflows:
say-hello-workflow: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
jobs:
- say-hello
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boilerplate CI config does nothing for the project

Low Severity

This .circleci/config.yml is a verbatim auto-generated CircleCI template whose only step is echo Hello, World!. The repository contains multiple real projects with build and lint scripts, but this CI config doesn't invoke any of them. It appears to be default scaffolding that was unintentionally included in the merge to main.

Fix in Cursor Fix in Web

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey!

125 changes: 125 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,128 @@
<h1 id="metamask-sdk-examples-monorepo">🚀 MetaMask SDK Examples Monorepo</h1>
This monorepo contains various example applications demonstrating the integration of MetaMask SDK across different frameworks, platforms and partners.

<h2 id="-getting-started">🚀 Getting Started</h2>

<p>Clone and install dependencies for all examples:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/MetaMask/metamask-sdk-examples.git
<span class="nb">cd </span>metamask-sdk-examples
</code></pre></div></div>

<h2 id="-repository-structure">📦 Repository Structure</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>metamask-sdk-examples/
├── quickstarts/ # Example applications
│ ├── javascript/ # JavaScript integration
│ ├── react/ # React + Vite integration
│ ├── next/ # Next.js integration
│ ├── react-native/ # React Native integration
│ ├──────────────────────────
│ ├── wagmi/ # Wagmi integration
│ ├── rainbowkit/ # RainbowKit integration
├── partners/ # Example applications with partners
│ ├── dynamic/ # Dynamic integration
│ ├── web3auth/ # Web3Auth integration
</code></pre></div></div>

<h2 id="-available-examples">🎯 Available Examples</h2>

<p>Each example in the <code class="language-plaintext highlighter-rouge">quickstarts/</code> directory demonstrates MetaMask SDK integration in different frameworks and scenarios:</p>

<ul>
<li><a href="quickstarts/react"><strong>React Example</strong></a>: Modern React application showcasing hooks and components</li>
<li><a href="quickstarts/next"><strong>Next.js Example</strong></a>: Server-side rendering and static site generation</li>
<li><a href="quickstarts/javascript"><strong>JavaScript Example</strong></a>: Pure JavaScript implementation without frameworks</li>
<li><a href="quickstarts/react-native"><strong>React Native Example</strong></a>: React Native integration example</li>
<li><a href="quickstarts/wagmi"><strong>Wagmi Example</strong></a>: Wagmi integration example</li>
<li><a href="quickstarts/rainbowkit"><strong>RainbowKit Example</strong></a>: RainbowKit integration example</li>
</ul>

<p>And each example in the <code class="language-plaintext highlighter-rouge">partners/</code> directory demonstrates MetaMask SDK integration with different partners:</p>

<ul>
<li><a href="partners/dynamic"><strong>Dynamic Example</strong></a>: Dynamic integration example</li>
<li><a href="partners/web3auth"><strong>Web3Auth Example</strong></a>: Web3Auth integration example</li>
</ul>

<h2 id="-development">🛠 Development</h2>

<h3 id="running-individual-examples">Running Individual Examples</h3>

<p>To run a specific example:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd</span> &lt;quickstarts or partners&gt;/&lt;example-name&gt;
pnpm <span class="nb">install</span> <span class="o">&amp;&amp;</span> pnpm dev
</code></pre></div></div>

<h2 id="cloning-individual-examples-using-degit">Cloning individual examples using <a href="https://www.npmjs.com/package/degit">degit</a></h2>

<ul>
<li><a href="quickstarts/react"><strong>React Example</strong></a>:
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npx degit MetaMask/metamask-sdk-examples/quickstarts/react mm-sdk-react-quickstart <span class="o">&amp;&amp;</span> <span class="nb">cd </span>mm-sdk-react-quickstart <span class="o">&amp;&amp;</span> npm <span class="nb">install</span> <span class="o">&amp;&amp;</span> npm run dev
</code></pre></div> </div>
</li>
<li><a href="quickstarts/next"><strong>Next.js Example</strong></a>:
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npx degit MetaMask/metamask-sdk-examples/quickstarts/next mm-sdk-nextjs-quickstart <span class="o">&amp;&amp;</span> <span class="nb">cd </span>mm-sdk-nextjs-quickstart <span class="o">&amp;&amp;</span> npm <span class="nb">install</span> <span class="o">&amp;&amp;</span> npm run dev
</code></pre></div> </div>
</li>
<li><a href="quickstarts/javascript"><strong>JavaScript Example</strong></a>:
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npx degit MetaMask/metamask-sdk-examples/quickstarts/javascript mm-sdk-javascript-quickstart <span class="o">&amp;&amp;</span> <span class="nb">cd </span>mm-sdk-javascript-quickstart <span class="o">&amp;&amp;</span> npm <span class="nb">install</span> <span class="o">&amp;&amp;</span> npm run dev
</code></pre></div> </div>
</li>
<li><a href="quickstarts/wagmi"><strong>Wagmi Example</strong></a>:
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npx degit MetaMask/metamask-sdk-examples/quickstarts/wagmi mm-sdk-wagmi-quickstart <span class="o">&amp;&amp;</span> <span class="nb">cd </span>mm-sdk-wagmi-quickstart <span class="o">&amp;&amp;</span> npm <span class="nb">install</span> <span class="o">&amp;&amp;</span> npm run dev
</code></pre></div> </div>
</li>
<li><a href="quickstarts/rainbowkit"><strong>RainbowKit Example</strong></a>:
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npx degit MetaMask/metamask-sdk-examples/quickstarts/rainbowkit mm-sdk-rainbowkit-quickstart <span class="o">&amp;&amp;</span> <span class="nb">cd </span>mm-sdk-rainbowkit-quickstart <span class="o">&amp;&amp;</span> npm <span class="nb">install</span> <span class="o">&amp;&amp;</span> npm run dev
</code></pre></div> </div>
</li>
<li><a href="partners/dynamic"><strong>Dynamic Example</strong></a>:
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npx degit MetaMask/metamask-sdk-examples/partners/dynamic mm-sdk-dynamic-quickstart <span class="o">&amp;&amp;</span> <span class="nb">cd </span>mm-sdk-dynamic-quickstart <span class="o">&amp;&amp;</span> npm <span class="nb">install</span> <span class="o">&amp;&amp;</span> npm run dev
</code></pre></div> </div>
</li>
<li><a href="partners/web3auth"><strong>Web3Auth Example</strong></a>:
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npx degit MetaMask/metamask-sdk-examples/partners/web3auth mm-sdk-web3auth-quickstart <span class="o">&amp;&amp;</span> <span class="nb">cd </span>mm-sdk-web3auth-quickstart <span class="o">&amp;&amp;</span> npm <span class="nb">install</span> <span class="o">&amp;&amp;</span> npm run dev
</code></pre></div> </div>
</li>
</ul>

<h2 id="-documentation">📚 Documentation</h2>

<p>Each example includes its own README with:</p>

<ul>
<li>Specific setup instructions</li>
<li>Implementation details</li>
<li>Best practices</li>
<li>Common issues and solutions</li>
</ul>

<h2 id="-contributing">🤝 Contributing</h2>

<p>We welcome contributions!</p>

<p>To add a new example:</p>

<ol>
<li>Fork the repository</li>
<li>Create a new branch</li>
<li>Add your example</li>
<li>Submit a pull request</li>
</ol>

<h2 id="-license">📝 License</h2>

<p>This project is licensed under the MIT License - see the LICENSE file for details.</p>

<h2 id="-useful-links">🔗 Useful Links</h2>

<ul>
<li><a href="https://docs.metamask.io/sdk/">MetaMask SDK Documentation</a></li>
<li><a href="https://github.com/MetaMask/metamask-sdk-examples/issues">Report Issues</a></li>
</ul>

# MetaMask SDK Examples Monorepo

This monorepo contains various example applications demonstrating the integration of MetaMask SDK across different frameworks, platforms and partners.
Expand Down
41 changes: 41 additions & 0 deletions examples/quickstart/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
37 changes: 37 additions & 0 deletions examples/quickstart/.vade-report
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Vercel Web Analytics Implementation

Successfully implemented Vercel Web Analytics for this Next.js App Router project.

## Changes Made

### 1. Installed Dependencies
- Installed `@vercel/analytics` package (v1.6.1) using pnpm
- Updated `package.json` to include the new dependency
- Generated `pnpm-lock.yaml` to lock dependency versions

### 2. Modified Files

#### `app/layout.tsx`
- Added import statement: `import { Analytics } from "@vercel/analytics/next";`
- Added `<Analytics />` component inside the `<body>` tag, placed after the `</main>` closing tag
- The component is properly positioned to track page views and web vitals

### 3. Verification Steps Completed
✅ Build completed successfully with `pnpm build`
✅ Linting passed with no errors using `pnpm lint`
✅ No TypeScript compilation errors
✅ All changes staged with git

## Implementation Details

The Analytics component was added to the root layout following Vercel's best practices for App Router projects:
- Imported from `@vercel/analytics/next` (the Next.js-specific package)
- Placed inside the `<body>` tag to ensure proper tracking across all pages
- Positioned after the main content to avoid blocking initial page rendering

## Notes

- This is an App Router project (uses `app/` directory structure)
- The Analytics component will automatically track page views and Web Vitals
- No environment variables or configuration needed for basic functionality
- Analytics data will be available in the Vercel dashboard once deployed
136 changes: 136 additions & 0 deletions examples/quickstart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Quickstart App

This quickstart application demonstrates how to integrate the **MetaMask SDK** with a **Next.js** application using **wagmi**. It showcases connecting to a wallet, switching networks, and interacting with Ethereum-based functionalities.

## Table of Contents

- [Quickstart App](#quickstart-app)
- [Table of Contents](#table-of-contents)
- [Introduction](#introduction)
- [Features](#features)
- [Project Structure](#project-structure)
- [`app/page.tsx`](#apppagetsx)
- [`app/layout.tsx`](#applayouttsx)
- [`wagmi.config.ts`](#wagmiconfigts)
- [`app/providers.tsx`](#appproviderstsx)
- [`components/navbar.tsx`](#componentsnavbartsx)
- [Technologies Used](#technologies-used)
- [Getting Started](#getting-started)
- [Contributing](#contributing)
- [License](#license)

## Introduction

The **Quickstart App** serves as a foundation for developers to build decentralized applications (dApps) using Next.js and MetaMask. It provides a seamless integration with the Ethereum blockchain, allowing users to connect their wallets, switch networks, and interact with smart contracts.

## Features

- **Wallet Connection**: Connect to MetaMask wallet seamlessly.
- **Network Switching**: Switch between Ethereum networks like Linea Sepolia, Linea, and Mainnet.
- **Interactive UI**: Responsive design with interactive cards guiding users.
- **Modular Components**: Easy-to-understand and customizable components.
- **Smart Contract Interaction**: Templates for interacting with smart contracts.

## Project Structure

The application is organized into several key components and configurations:

### `app/page.tsx`

This is the main landing page of the application. It displays a welcome message and interactive cards that guide users to various resources and functionalities.

- **Welcome Section**: Displays a welcome message and prompts users to connect their wallet.
- **Cards Section**: Contains interactive cards linking to documentation, testnet ETH, guides, and examples.

### `app/layout.tsx`

Defines the root layout of the application, including global styles, fonts, and providers.

- **Fonts**: Uses `Geist` and `Geist_Mono` fonts for styling.
- **Metadata**: Sets the page title and description.
- **Providers**: Wraps the application with necessary providers for state management.
- **Navbar**: Includes the navigation bar across all pages.

### `wagmi.config.ts`

Configures the `wagmi` client for blockchain interactions, specifying supported chains and storage.

- **Chains**: Supports Linea Sepolia, Linea, and Ethereum Mainnet.
- **Storage**: Uses cookies for storage to maintain state between sessions.
- **Transports**: Sets up HTTP transports for chain communication.

### `app/providers.tsx`

Sets up providers for state management and data fetching using `WagmiProvider` and `QueryClientProvider`.

- **WagmiProvider**: Provides Ethereum context and state.
- **QueryClientProvider**: Manages data fetching and caching.
- **Initial State**: Retrieves initial state from cookies for server-side rendering (SSR).

### `components/navbar.tsx`

The navigation bar that handles wallet connections, network switching, and displays user account information.

- **Logo**: Displays the MetaMask logo.
- **Wallet Connection**: Shows a **Connect Wallet** button if not connected.
- **Account Information**: Displays connected wallet address and allows disconnection.
- **Network Switching**: Enables users to switch between supported networks.

## Technologies Used

- **Next.js**: React framework for building server-side rendered and statically generated applications.
- **React**: JavaScript library for building user interfaces.
- **TypeScript**: Typed superset of JavaScript for improved developer experience.
- **wagmi**: React hooks library for Ethereum.
- **MetaMask SDK**: Enables interaction with the MetaMask wallet.
- **Tailwind CSS**: Utility-first CSS framework for rapid UI development.
- **Lucide Icons**: Open-source icon library for consistent iconography.
- **@tanstack/react-query**: Data fetching and caching library.

## Getting Started

To run the application locally, follow these steps:

1. **Clone the repository**

```bash
git clone https://github.com/MetaMask/metamask-sdk-examples.git
```

2. **Navigate to the project directory**

```bash
cd quickstart
```

3. **Install dependencies**

```bash
pnpm i
# or
yarn install
```

4. **Run the development server**

```bash
pnpm dev
# or
yarn dev
```

5. **Open your browser**

Visit [http://localhost:3000](http://localhost:3000) to see the application running.

## Contributing

Contributions are welcome! If you'd like to improve the app or add new features, please fork the repository and submit a pull request.

## License

This project is licensed under the [MIT License](LICENSE).

---

Feel free to customize and expand upon this README to suit your project's needs.
Binary file added examples/quickstart/app/favicon.ico
Binary file not shown.
Loading