Metamask
Connect MetaMask with Webflow to add wallet authentication, NFT galleries, and token-gated content.
How to integrate MetaMask with Webflow
Web3 functionality enables wallet-connected experiences like NFT galleries, token-gated content, and blockchain authentication. All MetaMask integrations require custom code.
The integrations include Web3Modal via CDN for the fastest setup and multi-wallet compatibility. Pre-built GitHub widgets work for specific use cases but require ongoing maintenance. MetaMask SDK provides official mobile support for complex interactions.
Use Web3Modal via CDN
Web3Modal provides CDN-based integration within the Webflow custom code constraints.
The features include the following:
- CDN integration with no build tools
- Wallet data display (addresses, ETH balances) via Ethers.js
- Session persistence with cacheProvider: true
- Light/dark theme customization
Place Ethers.js and Web3Modal CDN links in custom code in the head and body tags. Use defer attributes for external libraries and initialize within DOMContentLoaded. Test on the staging domain, as the custom code only works on published sites with HTTPS.
Use pre-built GitHub widgets
GitHub widgets like MetaMask button, Webflow, and Webflow NFT components provide functional connections without writing Web3 code from scratch.
Note: Most Web3 GitHub projects have inconsistent maintenance. Pin specific versions and test thoroughly before production.
The widget functionality includes the following:
- MetaMask connection via Ethers.js with automatic wallet detection
- NFT minting through smart contract integration
- Multi-chain support: Ethereum, Polygon, Arbitrum, Optimism, Base, BNB Chain
Create button elements with HTML IDs, add widget scripts to Before body tag section, and configure variables (CONTRACTADDRESS, ISTESTNET, MAXPERMINT). Test on testnets (Goerli/Sepolia) before mainnet.
Use MetaMask SDK
MetaMask SDK provides official desktop/mobile wallet support through a unified API — best for mobile support or complex wallet interactions.
SDK capabilities:
- Mobile wallet connection via deep linking
- Session persistence across refreshes
- Automatic desktop/mobile detection
- dappMetadata configuration for site identification
Install via CDN in custom code, initialize with dApp metadata, verify connection with eth_accounts, and implement error handling. Mobile integration triggers deep links to MetaMask app for approval.
Display NFT galleries
Query blockchain data through Alchemy, Infura, or QuickNode using REST APIs or JSON-RPC endpoints. Fetch NFT data after wallet connection, then dynamically create HTML elements.
API calls take 5-30 seconds. Implement loading states and error handling.
Example using Alchemy:
const ALCHEMY_API_KEY = "YOUR_API_KEY";
const walletAddress = "0x...";
fetch(`https://eth-mainnet.g.alchemy.com/nft/v3/${ALCHEMY_API_KEY}/getNFTsForOwner?owner=${walletAddress}`)
.then(res => res.json())
.then(data => {
data.ownedNfts.forEach(nft => {
const img = document.createElement('img');
img.src = nft.media[0].gateway;
img.alt = nft.title;
document.getElementById('nft-gallery').appendChild(img);
});
})
.catch(error => console.error('Failed to fetch NFTs:', error));
What you can build
Web3 integrations with Webflow help build blockchain-enabled site features. All implementations require custom code:
- NFT minting platforms: Wallet connection + direct minting. Requires smart contracts, gas handling, and supply tracking.
- Token-gated membership sites: Access restricted to NFT/token holders. Server-side verification required.
- DeFi landing pages: Wallet connection + balance display. Smart contract interaction requires development expertise.
- Web3 authentication systems: Wallet-based login via cryptographic signatures. Requires backend setup.
Frequently asked questions
Standard mobile browsers (Safari, Chrome) cannot use MetaMask's browser extension. Mobile integration requires deep linking and MetaMask SDK.
Solutions:
- MetaMask SDK: Direct mobile integration via deep linking
- WalletConnect: Broader wallet support via QR codes/universal links
MetaMask SDK auto-detects mobile environments and triggers deep links. Users should use MetaMask mobile app's built-in browser for optimal integration.
Webflow enforces 50,000-character maximum per custom code section. Web3.js and Ethers.js require CDN references rather than inline embedding.
CSP configuration: Enterprise customers only via Webflow security headers. Others can use Cloudflare or reverse proxies.
Scripts load synchronously by default. Use defer attributes and wrap initialization in window.addEventListener('load', …). Include .webflow.io and .canvas.webflow.com domains for preview environments.
Built-in support: Ethereum, Optimism, Base, BNB Chain, Polygon, Arbitrum.
Switch networks via wallet_switchEthereumChain. Error 4902 indicates wallet_addEthereumChain needed first.
Chain IDs:
- Ethereum Mainnet: 0x1
- Polygon: 0x89
- Arbitrum One: 0xa4b1
- Optimism: 0xa
- Base: 0x2105
- BNB Chain: 0x38
Detect MetaMask using the EIP-6963 standard (
eip6963:announceProviderevent listener) instead of the deprecatedwindow.ethereummethod. For users on browsers that don't support EIP-6963, display upgrade prompts.The EIP-1193 specification defines the Ethereum Provider standard that MetaMask implements. This specification enables wallet integration with websites through the standardized
window.ethereumJavaScript API.Mobile browser behavior differs from desktop extensions. The MetaMask mobile security report highlights critical differences in mobile implementations compared to desktop browser extensions. MetaMask's documentation notes that mobile implementations differ substantially from desktop browser extensions in their architecture and user experience, with mobile wallet interactions requiring different integration approaches than desktop extension-based flows.
Description
MetaMask is a cryptocurrency wallet and Web3 gateway for blockchain applications. It supports Ethereum, Polygon, Arbitrum, Optimism, Base, and BNB Chain. Users can connect to dApps, sign transactions, and manage digital assets from browser or mobile.
This integration page is provided for informational and convenience purposes only.

Amazon Pay
Connect Amazon Pay (a secure digital payment service) with Webflow to streamline checkout and reduce cart abandonment with trusted Amazon account credentials.


