Overview
PolygonKit supports multiple Polygon networks out of the box. You can configure which chains your application supports through thePolygonKitProvider configuration.
Supported Chains
Polygon PoS Mainnet
The main Polygon network - a sidechain of Ethereum with low fees and fast transactions.- Chain ID:
137 - Currency: MATIC
- Block Explorer: https://polygonscan.com
- RPC: https://polygon-rpc.com
Polygon Amoy Testnet
The latest Polygon testnet for development and testing.- Chain ID:
80002 - Currency: MATIC (test tokens)
- Block Explorer: https://amoy.polygonscan.com
- Faucet: https://faucet.polygon.technology
Amoy replaced Mumbai as the official Polygon testnet in 2024.
Polygon zkEVM Mainnet
A Layer 2 scaling solution using zero-knowledge proofs.- Chain ID:
1101 - Currency: ETH
- Block Explorer: https://zkevm.polygonscan.com
- Bridge: https://portal.polygon.technology
Polygon zkEVM Testnet
Testnet for Polygon zkEVM.- Chain ID:
1442 - Currency: ETH (test tokens)
- Block Explorer: https://testnet-zkevm.polygonscan.com
- Faucet: Available through bridge
Multiple Chains
Configure your app to support multiple networks:Custom RPC URLs
Override default RPC URLs for better performance or custom endpoints:Chain-Specific Configuration
Development (Testnet Only)
For development, only use testnets:Production (Mainnet + Testnet)
For production, support both mainnet and testnet:Accessing Current Chain
Use theusePolygonKit hook to get the current chain:
Switching Chains
Users can switch chains through the wallet dropdown, or you can programmatically switch:Chain Icons and Metadata
PolygonKit automatically provides chain icons and metadata for all supported Polygon chains. The chain logo appears in the wallet dropdown.Best Practices
Start with Testnet
Start with Testnet
Always develop and test on Amoy testnet before deploying to mainnet.
Limit Chain Selection
Limit Chain Selection
Only include chains your app actually uses. Too many options can confuse users.
Handle Chain Mismatches
Handle Chain Mismatches
Always check if the user is on the correct chain before executing transactions.
Use Environment Variables
Use Environment Variables
Configure chains based on environment (development vs production).
Example: Chain Guard
Create a component that ensures users are on the correct chain:Chain Detection
Detect which chain the user is on:Troubleshooting
Chain not available in wallet
Chain not available in wallet
If a chain doesn’t appear in MetaMask or other wallets, you may need to add it manually. Provide an “Add Network” button in your UI.
Wrong chain after connecting
Wrong chain after connecting
Some wallets remember the last used chain. Prompt users to switch chains after connection if needed.
RPC errors
RPC errors
If you see RPC errors, try using a custom RPC URL or check if the default RPC is experiencing issues.
Additional Resources
Polygon PoS Docs
Official Polygon PoS documentation
Polygon zkEVM Docs
Official Polygon zkEVM documentation
Get Test Tokens
Polygon faucet for test MATIC
Block Explorers
View transactions and contracts