SPACE ID offers a seamless solution for partners to integrate .bnb, .arb, and .eth domain name registrations into their platforms. By leveraging our web3-name-sdk, partners can customize front-end interfaces, enabling users to effortlessly secure unique Web3 domains. Eligible partners also earn commissions for .arb and .bnb registrations processed through their portals.
Installation
Install the web3-name-sdk alongside ethers v5 (compatible with most projects) via npm or yarn:
npm install @web3-name-sdk/register [email protected]yarn add @web3-name-sdk/register [email protected]For Next.js Users:
Add this to next.config.js to transpile CommonJS dependencies:
const nextConfig = {
transpilePackages: ['@web3-name-sdk/register'],
}Registration Workflow
- Domain Availability Check: Verify if the desired domain is valid and available.
- Fee Query: Retrieve the registration cost based on domain length and duration.
- Registration: Users submit required parameters and fees to complete the process.
Code Implementation
BNB Domain Registration
import SIDRegister from '@web3-name-sdk/register';
import { providers } from 'ethers';
async function registerDomain(label: String) {
if (window.ethereum) {
const provider = new providers.Web3Provider(window.ethereum);
await provider.send('wallet_switchEthereumChain', [{ chainId: '0x38' }]); // BSC chain
await provider.send('eth_requestAccounts', []);
const signer = provider.getSigner();
const address = await signer.getAddress();
const register = new SIDRegister({ signer, chainId: 56 }); // BNB chainId: 56
const available = await register.getAvailable(label);
const price = await register.getRentPrice(label, 1);
await register.register(label, address, 1, {
setPrimaryName: true, // Optional: Set as primary domain
referrer: 'test.bnb', // Optional: Earn commissions
});
}
}👉 Explore BNB domain integration
ARB Domain Registration
const register = new SIDRegister({ signer, chainId: 42161 }); // Arbitrum chainId: 42161
// ... (similar workflow as BNB)
await register.register(label, address, 1);Key Notes:
- Label: Domain prefix (e.g.,
testfortest.arb). - Primary Name: Displays in dApps; defaults to
false. - Referrer: Resolves to the referrer’s address for commission payouts.
ETH Domain Registration
const register = new SIDRegister({ signer, chainId: 1 }); // ETH chainId: 1
// ETH requires a 60-second commit wait:
await register.register(label, address, 1, {
onCommitSuccess: (waitTime) => {
return new Promise(resolve => setTimeout(resolve, waitTime * 1000));
}
});Restrictions:
- Referrers and
setPrimaryNameunavailable for ETH domains.
FAQ
1. How do I check domain availability?
Use register.getAvailable(label)—returns true if the domain is open.
2. What determines registration fees?
Fees vary by domain length (shorter = pricier) and registration duration.
3. Can I integrate without coding?
No. The SDK requires custom front-end development.
👉 Learn advanced SDK configurations
4. How are referrer commissions paid?
Commissions are sent to the resolver address of the referrer’s domain (e.g., referrer.arb).
5. Why use ethers v5 instead of v6?
v6 has breaking changes; SPACE ID prioritizes stability with v5.
6. Is ETH registration slower?
Yes. A 60-second commit phase is mandatory before finalizing.
For further details, refer to the official npm package.