> For the complete documentation index, see [llms.txt](/llms.txt).

# Use MetaMask Smart Accounts with Scaffold-ETH 2

Use the [MetaMask Smart Accounts extension](https://github.com/metamask/gator-extension) for [Scaffold-ETH 2](https://docs.scaffoldeth.io/) to bootstrap a project in under two minutes. This extension helps you quickly generate the boilerplate code to create an embedded [smart account](/smart-accounts-kit/development/reference/glossary#metamask-smart-account)**MetaMask smart account** A smart contract account created using the Smart Accounts Kit that supports programmable behavior, flexible signing options, and ERC-7710 delegations., and complete the [delegation](/smart-accounts-kit/development/reference/glossary#delegation)**Delegation** The ability for a MetaMask smart account to authorize another account to perform specific executions on its behalf. lifecycle (create, sign, and redeem a delegation).

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

- Install [Node.js](https://nodejs.org/en/blog/release/v20.18.3) v20.18.3 or later.
- Install [Yarn](https://yarnpkg.com/) package manager.
- Install [Git](https://git-scm.com/install/).
- [Create a Pimlico API key](https://docs.pimlico.io/guides/create-api-key#create-api-key).

## Steps[​](#steps "Direct link to Steps")

### 1\. Install the extension[​](#1-install-the-extension "Direct link to 1. Install the extension")

Run the following command to install the Smart Accounts Kit extension:

```
npx create-eth@latest -e metamask/gator-extension your-project-name

```

### 2\. Set up environment variables[​](#2-set-up-environment-variables "Direct link to 2. Set up environment variables")

Navigate into the project's `nextjs` package, and create a `.env.local` file. Once created, update the `NEXT_PUBLIC_PIMLICO_API_KEY` environment variable with your Pimlico API Key.

```
cd your-project-name/packages/nextjs
cp .env.example .env.local

```

### 3\. Start the frontend[​](#3-start-the-frontend "Direct link to 3. Start the frontend")

In the project's root directory start the development server.

```
yarn start

```

### 4\. Complete the delegation lifecycle[​](#4-complete-the-delegation-lifecycle "Direct link to 4. Complete the delegation lifecycle")

Navigate to the **MetaMask Smart Accounts & Delegation** page in your Scaffold-ETH frontend at <http://localhost:3000/delegations>, and follow the steps to deploy a [delegator account](/smart-accounts-kit/development/reference/glossary#delegator-account)**Delegator account** The account that creates and signs a delegation to grant limited authority to another account., create a [delegate](/smart-accounts-kit/development/reference/glossary#delegate-account)**Delegate account** The account that receives delegated authority and can redeem a delegation under its constraints. wallet, and create and redeem a delegation.

You can view the completed transaction on Etherscan.

![Scaffold-ETH 2 Smart Accounts & Delegation Page](/assets/images/scaffold-eth-smart-accounts-d777aed0bcf484ef0862aa7a712c4513.png)

## Next steps[​](#next-steps "Direct link to Next steps")

Learn more about [MetaMask Smart Accounts](/smart-accounts-kit/concepts/smart-accounts/) and [delegation](/smart-accounts-kit/concepts/delegation/overview/).
