MetaMask
Add MetaMask wallet connection to Webflow pages with custom code, then verify signatures on your own server before you gate content or write to the CMS.

A Webflow site has no built-in way to read a visitor's crypto wallet. Custom code sections run only HTML, CSS, and JS, so signature checks and token verification need extra tooling. MetaMask wallets hold the keys and addresses that Web3 sites need to recognize.
Connecting MetaMask and Webflow adds a Connect wallet button to any page you design. Visitors approve the request in the MetaMask extension or mobile app, and your script receives their address and chain ID. With a small server in the loop, you can use that address to gate pages, record mints, or create items in the Webflow CMS.
This integration fits developers and agencies building NFT, DeFi, and Web3 gaming sites. Marketing teams at crypto companies can keep page design in Webflow while engineers own the wallet code. Community managers running token-gated memberships also benefit, as long as someone hosts server-side verification.
How to integrate MetaMask with Webflow
What is MetaMask? MetaMask is a self-custodial crypto wallet from Consensys, available as a browser extension and as iOS and Android apps. Users hold their own keys and approve each connection, signature, and transaction a site requests. Its developer tools include MetaMask Connect, which links websites to the extension and the mobile app.
Teams pair MetaMask with Webflow when the marketing site and the onchain product share the same pages. A product team can launch a mint page or a members area without moving the site into a separate React app. Wallet code runs in the browser. Anything that must be trusted, such as a signature check or an API token, runs on a server you control.
The MetaMask-Webflow integration supports 2 approaches:
- Code Embed and site custom code load MetaMask Connect EVM or a wallet widget in the browser, with no server required.
- The Webflow and MetaMask APIs give you full control over signature checks, token gating, and CMS writes, but require server-side development.
Most implementations combine both methods, depending on the setup's complexity.
Add MetaMask with Code Embed and custom code
Client-side scripts can connect MetaMask, read the visitor's address, request signatures, and switch networks. Load them site-wide from Site settings, or on one page with a Code Embed element. Each code section accepts up to 50,000 characters of HTML, CSS, and JS. You need a Core, Growth, Agency, or Freelancer Workspace, or an active Site plan. Scripts appear in preview but run live only after you publish.
Load MetaMask Connect EVM from site custom code
MetaMask Connect EVM (@metamask/connect-evm) is the current connection package and replaces the deprecated @metamask/sdk. It detects the visitor's environment and picks the browser extension, a QR code, or a mobile deeplink. The official quickstart installs it with npm and shows no CDN script tag. You bundle it in a JavaScript project, host the file, and reference it from Webflow.
To set it up:
- Run
npm install @metamask/connect-evmin a JavaScript project. Vite and Webpack builds work without polyfills. - Create the client and attach it to a button ID, as in the example below.
- Build the bundle and host it on your own server or CDN.
- Go to Site settings > Custom code and add
<script src="https://your-host.com/wallet.js" defer></script>to Footer code. - Click Save changes.
- Add a Button element and set its ID to
connectBtnin the Settings panel. - Publish to the webflow.io staging subdomain and test before publishing to your custom domain.
The client setup uses documented createEVMClient options and the connect method:
import { createEVMClient } from '@metamask/connect-evm';
const evmClient = await createEVMClient({
dapp: { name: 'Example Webflow site' },
api: { supportedNetworks: { '0x1': 'https://your-rpc-url' } },
});
document.getElementById('connectBtn').addEventListener('click', async () => {
try {
const { accounts, chainId } = await evmClient.connect({ chainIds: ['0x1'] });
console.log(evmClient.getAccount(), chainId);
} catch (err) {
if (err.code === 4001) { /* user rejected: show a retry button */ }
if (err.code === -32002) { /* request pending: ask the user to check MetaMask */ }
}
});
Error 4001 means the visitor rejected the request. MetaMask notes that a cancellation can also arrive wrapped in an outer code 53 with the wallet's code on err.rpcCode, so normalize errors before you branch on them. Error -32002 means a request is already pending, so don't call connect() again. Add every chain your site uses to supportedNetworks, because requests to unconfigured chains throw. MetaMask recommends an Infura API key for production, and the getInfuraRpcUrls helper builds the RPC map for you.
Add a CDN wallet widget
Third-party multi-wallet libraries and open-source GitHub widgets can add a MetaMask button without a build step, provided they publish a browser-ready bundle you can load from a CDN. Third parties produce these projects; MetaMask does not.
To add a widget:
- Add Button elements and give each the HTML ID the widget expects.
- Open Page settings and paste the widget scripts in the Before
</body>tag section. - Set the widget's configuration variables, such as supported chains.
- Pin the script version in the CDN URL and test on staging.
Many Web3 GitHub projects have inconsistent maintenance, so check the repository's activity before you ship.
Send mobile visitors to the MetaMask in-app browser
Safari and Chrome on mobile can't use the MetaMask browser extension. MetaMask Connect opens the mobile app with a deeplink, but you can also link straight to the app's built-in browser. The https://link.metamask.io/dapp/{dappUrl} format opens your page inside MetaMask Mobile, where wallet connection works.
To add the link:
- Add a Link Block or Button to the page.
- In its settings, set the URL to
https://link.metamask.io/dapp/followed by your site's URL. - Publish and test the link on an iOS or Android device with MetaMask installed.
WebViews inside Twitter, Discord, or Reddit handle deeplinks inconsistently, so test any link you share on social platforms.
Build with the Webflow and MetaMask APIs
Webflow Cloud can host a Next.js or Astro app with server route handlers next to your site. Store the Webflow token as a secret environment variable so it never reaches the browser.
These APIs cover the server-side path:
- MetaMask Connect EVM: The EVM methods reference covers
connect,connectAndSign,switchChain, and provider access in the browser. - Webflow Data API: Webflow's Data API creates and publishes items in your CMS collections and reads form submissions.
- Webflow webhooks: Webflow webhooks send a request to your server when a form is submitted or a Collection item changes.
- Webflow Cloud: Your server routes run next to the site, verify signatures, and keep the Webflow token in a secret environment variable.
In a Webflow build, MetaMask Connect runs in the visitor's browser, so your server receives wallet data from your own browser code.
Save wallet addresses to the Webflow CMS
After a visitor connects, your browser script sends the selected address to a server route. That route creates a CMS item through the Data API. A Collection List can then display those items on the site. Use a site token for internal builds and OAuth for integrations other people install.
To implement this:
- Read the address with
evmClient.getAccount(). Don't assumeaccounts[0]is the active account. - Send the address from the browser to your server route with
fetch. - On the server, call
POST https://api.webflow.com/v2/collections/{collection_id}/items/livewith anAuthorization: Bearerheader and a top-levelfieldDataobject. The endpoint needs theCMS:writescope. - To stage drafts instead, create items with
POST /collections/{collection_id}/items. - Publish staged items later with
POST https://api.webflow.com/v2/collections/{collection_id}/items/publish.
Live creates return HTTP 202. A request that sends both fieldData and an items array returns a 400.
Gate content with signature and token checks
Wallet sign-in and token gating both start with a signed message. User Accounts were sunset on January 29, 2026, and their content gates were removed, so gating now runs on your own server. Keep the ownership check on your server, where visitors can't edit it.
To implement this:
- Build a Sign-In with Ethereum message with your domain from
window.location.host, a nonce, and anIssued Attime. - Call
evmClient.connectAndSign({ message }). It connects and signs in one approval and returnsaccounts,chainId, andsignature. - Send the address, message, and signature to your server and verify the signature there.
- Check token ownership with a
balanceOfread througheth_callor viem'sreadContract. - Return gated content or a session only to verified holders.
Your server owns the nonce, domain, and expiry checks. MetaMask warns users when a SIWE domain doesn't match the site, but it doesn't stop them from signing, so the server-side domain check still matters.
React to Webflow events with webhooks
Webhooks send a POST request to your server when events happen on the site. Relevant triggers include form_submission, collection_item_created, and collection_item_published. Your server can use them to run follow-up work, such as updating its own wallet records when a Collection item publishes.
To set up a webhook:
- Get a site token, or a Data Client App token with the
sites:writescope that the Create Webhook endpoint requires. The webhooks guide also listsforms:readfor form events. - Find your site ID with
GET https://api.webflow.com/v2/sites. - Send a
POSTtohttps://api.webflow.com/v2/sites/YOUR_SITE_ID/webhookswithtriggerTypeandurlin the body. - Add a
filterwith a form name to limitform_submissionevents to one form. - Validate
x-webflow-signatureas a SHA-256 HMAC of the timestamp, a colon, and the request body. - Reject requests whose
x-webflow-timestampis more than 5 minutes old, then return a200.
Webhooks added in Site settings carry no signature headers, so register them through the API when you need to validate requests. A registration made with a site token returns a secretKey to use as the signing key, and OAuth app webhooks sign with the app's client secret. Failed deliveries retry up to three more times at 10-minute intervals.
What you can build with the MetaMask Webflow integration
Integrating MetaMask with Webflow lets you add wallet connection, signing, and onchain reads to designed pages without building a separate dApp frontend.
- NFT mint pages: Design the mint page in Webflow and load MetaMask Connect from site custom code, so collectors approve the mint transaction in their own wallet.
- Token-gated membership areas: Build a members page for an NFT community that shows holder-only resources after your server confirms ownership.
- Wallet sign-in for web3 products: Replace email login on a product site with a Sign-In with Ethereum button that hands verified visitors to a dashboard hosted on Webflow Cloud.
- Holder directories: Save each verified wallet address as a CMS item through your server route, then list the entries on the site with a Collection List.
The server-side gate is the same pattern Webflow uses for any login provider. Follow our role-gated portal guide to build it on Webflow Cloud.
Frequently asked questions
No. The Webflow Marketplace doesn't list a MetaMask app, so you add wallet connection with custom code. Load MetaMask Connect EVM from site custom code or a Code Embed element, or add a third-party multi-wallet widget that supports MetaMask.
Not for the wallet connection itself. MetaMask Connect runs in the visitor's browser, so the connection happens on your page. Send wallet data from your browser code to your own server, then call the Webflow Data API or react to Webflow webhooks from there.
Yes, through deeplinks or the MetaMask app's built-in browser. On desktop without the extension, it shows a QR code to scan with the app. The supported platforms page lists each environment. MetaMask's Help Center recommends the built-in mobile browser, because other mobile browsers will most likely block dapp connections.
Custom code needs a Core, Growth, Agency, or Freelancer Workspace, or a site with an active Site plan. That covers both site-wide footer code and Code Embed elements, and the custom code guide covers placement and the 50,000-character limit. Our support team can't troubleshoot custom code, so take setup questions to the Webflow Community.
Use MetaMask Connect EVM for new builds. MetaMask marked the legacy SDK deprecated in its 25 March 2026 release, and the migration guide maps
new MetaMaskSDK(opts)toawait createEVMClient(opts). New builds start from the JavaScript quickstart, which requires Node.js 19 or later and an Infura API key.

Description
Add MetaMask wallet connection to Webflow pages with Code Embed elements and site custom code, then use the Webflow Data API to save verified wallet data.
This integration page is provided for informational and convenience purposes only.

Vault Vision User Authentication
Add passkey, social, and password logins to Webflow with Vault Vision, then gate pages in the browser or verify sessions on a server for private content.
Salesforce Authenticator
Use Salesforce Authenticator as the two-factor app on your Webflow account, and as the MFA prompt on the Salesforce logins behind your Webflow forms.
Microsoft Authenticator
Use Microsoft Authenticator as the second factor on your Webflow account, and add Authenticator MFA to site visitor logins through an identity provider.
Magic
Connect Magic (magic.link), a passwordless authentication SDK, with Webflow to add email OTP, social login, and Web3 wallet capabilities to your site.

LastPass Authenticator
LastPass Authenticator offers a unique one-tap password verification experience.

Google Authenticator
Google Authenticator generates single-use 2SV codes on Android or Apple mobile devices

Firebase Authentication
Connect Firebase Authentication, a Google-backed identity service, with Webflow to add user sign-up, sign-in, and session management using email, phone, or social login providers.
Authy
Use the Authy app for Webflow account 2FA, and add Twilio Verify codes to forms and logins, since the Authy API is closed to new customers.


