The bridge between Web 2.0 and Web 3.0 for your site/app! Similar to the BlueMirror addon, but built as a comprehensive JavaScript library to seamlessly integrate blockchain functionality into traditional web applications.
- π Easy Web2-to-Web3 Integration - Seamless bridge between traditional web applications and blockchain networks
- β‘ Lightweight & Fast - Minimal dependencies with optimal performance
- π Secure by Default - Built-in security best practices for crypto operations
- π Multi-Chain Support - Compatible with Ethereum, Polygon, and other EVM-compatible chains
- π± React & Vue Compatible - Works with modern frontend frameworks
- π― Developer-Friendly API - Intuitive and well-documented interface
npm install web23.jsyarn add web23.jspnpm add web23.jsimport Web23 from 'web23.js';
// Initialize the library
const web23 = new Web23({
chainId: 1, // Ethereum mainnet
rpcUrl: 'https://eth.public-rpc.com'
});// Connect to user's wallet
const wallet = await web23.connectWallet();
console.log('Connected:', wallet.address);// Interact with smart contracts
const result = await web23.call({
contract: '0x...',
method: 'balanceOf',
params: ['0x...']
});Establishes a connection to the user's wallet (MetaMask, WalletConnect, etc.)
- Returns:
Promise<{ address: string, balance: string }>
Execute a read-only smart contract call
options.contract- Contract addressoptions.method- Contract method nameoptions.params- Method parameters- Returns:
Promise<any>
Execute a transaction to modify blockchain state
options.contract- Contract addressoptions.method- Contract method nameoptions.params- Method parametersoptions.value- ETH amount (optional)- Returns:
Promise<{ hash: string, receipt: TransactionReceipt }>
const web23 = new Web23({
chainId: 1, // Network ID
rpcUrl: 'https://...', // RPC endpoint
gasMultiplier: 1.1, // Gas fee multiplier
timeout: 30000 // Request timeout in ms
});- Ethereum (Mainnet & Testnets)
- Polygon (Matic)
- Binance Smart Chain
- Arbitrum
- Optimism
- And more EVM-compatible chains
import Web23 from 'web23.js';
import { useState } from 'react';
function App() {
const [account, setAccount] = useState(null);
const web23 = new Web23();
const handleConnect = async () => {
const wallet = await web23.connectWallet();
setAccount(wallet.address);
};
return (
<div>
<button onClick={handleConnect}>Connect Wallet</button>
{account && <p>Connected: {account}</p>}
</div>
);
}We welcome contributions! Please see our CONTRIBUTING.md for guidelines.
git clone https://github.com/Web3HQ/web23.js.git
cd web23.js
npm install
npm test
npm run buildQ: "User rejected the request"
- A: User declined the wallet connection. App should handle this gracefully.
Q: High gas fees?
- A: Consider using Layer 2 solutions like Polygon or Arbitrum for cheaper transactions.
Q: Network errors?
- A: Check RPC endpoint health and your internet connection.
MIT Β© 2026 Web3HQ
- π Documentation
- π¬ Discussions
- π Report Issues
Built with β€οΈ to bridge Web 2.0 and Web 3.0