# @metamask/smart-accounts-kit

> Toolkit for managing and interacting with MetaMask Smart Accounts, built on Viem

Latest version **2.0.0** (published 2026-08-13) · (MIT-0 OR Apache-2.0) license · 0 weekly downloads

## Install

```sh
npm install @metamask/smart-accounts-kit
pnpm add @metamask/smart-accounts-kit
yarn add @metamask/smart-accounts-kit
bun add @metamask/smart-accounts-kit
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-08-13 |
| First published | 2025-11-10 |
| Weekly downloads | 0 |
| License | (MIT-0 OR Apache-2.0) |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 7 |
| Unpacked size | 3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 63 |
| Maintainers | kumavis, frederikbolding, metamaskbot, gudahtt, mrten, mcmire, naugtur |
| Keywords | MetaMask, Ethereum |

## Links

- npm: https://www.npmjs.com/package/@metamask/smart-accounts-kit
- Repository: https://github.com/MetaMask/smart-accounts-kit
- Homepage: https://github.com/MetaMask/smart-accounts-kit/tree/main/packages/smart-accounts-kit#readme
- Issues: https://github.com/MetaMask/smart-accounts-kit/issues
- npm.io page: https://npm.io/package/@metamask/smart-accounts-kit

## Dependencies (7)

- [ox](https://npm.io/package/ox.md) 0.8.1
- [openapi-fetch](https://npm.io/package/openapi-fetch.md) ^0.13.5
- [@metamask/utils](https://npm.io/package/@metamask/utils.md) ^11.4.0
- [@metamask/delegation-abis](https://npm.io/package/@metamask/delegation-abis.md) ^2.0.0
- [@metamask/delegation-core](https://npm.io/package/@metamask/delegation-core.md) ^3.0.0
- [@metamask/7715-permission-types](https://npm.io/package/@metamask/7715-permission-types.md) ^2.0.0
- [@metamask/delegation-deployments](https://npm.io/package/@metamask/delegation-deployments.md) ^2.0.0

## Recent versions

- 2.0.0 (latest) — 2026-08-13
- 1.7.0 — 2026-07-20
- 1.6.0 — 2026-05-27
- 1.5.0 — 2026-05-12
- 1.4.0 — 2026-05-05
- 1.3.0 — 2026-04-23
- 1.2.0 — 2026-04-15
- 1.1.0 — 2026-04-09
- 1.0.0 — 2026-03-27
- 0.4.0-beta.2 — 2026-03-23
- 0.4.0-beta.1 — 2026-01-26
- 0.4.0-beta.0 — 2026-01-15
- 0.3.0 — 2025-12-17
- 0.2.0 — 2025-12-03
- 0.1.0 — 2025-11-10

## README

# MetaMask Smart Accounts Kit

The MetaMask Smart Accounts Kit is a [Viem](https://viem.sh)-based collection of tools for integrating MetaMask Smart Account and creating frictionless new experiences based on granular permission sharing and trust.

## Features

---

- **Smart Account Support**: Provides high-level API for deploying, and managing MetaMask smart account.
- **Delegation Framework Support**: Comprehensive support for [ERC-7710](https://eips.ethereum.org/EIPS/eip-7710) to create, manage, and redeem delegations.
- **Prebuilt Caveat Enforcers**: Prebuilt caveat enforcers for adding restrictions and conditions to delegations.
- **Modular and Extensible**: Enables configuration of custom bundlers, paymasters, signers, and specialized caveat enforcers.
- and many more...

## Installation

---

Yarn:

```sh
yarn add @metamask/smart-accounts-kit viem
```

Npm:

```sh
npm install @metamask/smart-accounts-kit viem
```

`viem` is a peer dependency; install a compatible version alongside the kit.

## Overview

---

```ts
import { createPublicClient, http } from 'viem';
import { sepolia as chain } from 'viem/chains';
import { privateKeyToAccount } from 'viem/accounts';
import {
  Implementation,
  toMetaMaskSmartAccount,
} from '@metamask/smart-accounts-kit';

const publicClient = createPublicClient({
  chain,
  transport: http(),
});

const account = privateKeyToAccount('0x...');

const smartAccount = await toMetaMaskSmartAccount({
  client: publicClient,
  implementation: Implementation.Hybrid,
  deployParams: [account.address, [], [], []],
  deploySalt: '0x',
  signer: { account },
});
```

## Documentation

---

[Head to our documentation](https://docs.gator.metamask.io) to learn more about the MetaMask Smart Accounts Kit.

## Analytics

This package collects anonymous usage analytics to help us understand how it's being used and prioritize improvements. No personal information is collected. **[Analytics can be disabled](#disabling-analytics)**.

### What's collected

Two event types are sent (namespace `metamask/smart-accounts-kit`): a one-time **initialized** event when the first instrumented API runs (just before the first **function called** event), and **function called** events when those APIs run afterward. Both include a small **session base**; function events add which API was used and optional **parameters**.

- **`sdk_version`** — Kit version.
- **`anon_id`** — Random id regenerated on each SDK initialization for correlating events within that session. It is not derived from wallet or personal data, is not written to local storage or cookies for tracking purposes, and is not used to identify or track a user across sites or apps.
- **`platform`** — Coarse runtime (`web-desktop`, `web-mobile`, or `nodejs`).
- **`domain`** *(web only, when available)* — Current page hostname.

- **`function_name`** — Stable internal name of the API that was called.
- **`parameters`** *(optional)* — Only coarse, non-identifying data: things like numeric **chain id**, **counts** (e.g. calls, caveats, signatures), **booleans** (whether optional inputs were present), **implementation or scope _type_** from fixed enums, and **high-level labels** (e.g. which known delegation-storage tier or filter mode). No raw addresses, hashes, calldata, keys, or permission payloads.

### What's NOT collected

- **Secrets and credentials** — Private keys, API keys, bearer tokens, RPC or bundler URLs, and similar.
- **On-chain identifiers and payloads** — Account or contract addresses, transaction `to` / `data` / `value`, user operation calldata, delegation bodies, delegation hashes, permission request or response payloads, and signature bytes.
- **Personal information** — No names, emails, or other PII is sent as part of this analytics design.

### Disabling analytics

Analytics is not initialized when any of the following is set to: `1`, or `yes` / `true` (case-insensitive):

- **`CI`** environment variable (Node.js)
- **`DO_NOT_TRACK`** environment variable (Node.js)
- **`navigator.doNotTrack`** or **`window.doNotTrack`** (in browsers).

## Contributing

---

If you are interested in contributing, please [see the contribution guide](/CONTRIBUTING.md#Contributing).

## Useful Links

- [MetaMask Smart Accounts Kit Quick start](https://docs.metamask.io/smart-accounts-kit/get-started/quickstart/)
- [MetaMask Smart Accounts Kit CLI Quick start](https://docs.metamask.io/smart-accounts-kit/get-started/use-the-cli)
- [Scaffold ETH extension](https://github.com/metamask/gator-extension)
- [API reference](https://docs.metamask.io/smart-accounts-kit/reference/smart-account/)

---
_Source: https://npm.io/package/@metamask/smart-accounts-kit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
