Network Configuration
Overview
The @vechain/react-native-wallet-link library allows you to connect your dApp to any VeChain network — including Mainnet, Testnet, or a custom node (e.g., for local development or staging).
The network node is passed as the node prop in the VeWorldProvider component.
Supported Networks
You can import VeChain’s default node URLs directly from @vechain/sdk-network:
import { MAINNET_URL, TESTNET_URL } from '@vechain/sdk-network';🟢 Mainnet
Use when deploying your app to production.
<VeWorldProvider
appName="My VeChain App"
appUrl="https://myvechainapp.com"
redirectUrl={Linking.createURL('/', { scheme: 'myvechainapp' })}
node={MAINNET_URL}
config={/* event handlers */}
>
{/* App */}
</VeWorldProvider>Purpose: Real VeChain transactions
Network ID: 1
Explorer: https://explore.vechain.org
🧪 Testnet
Use during development and testing.
Purpose: Safe test environment with free tokens
Network ID: 100009
Explorer: https://explore-testnet.vechain.org
⚙️ Custom Node
You can also connect to your own VeChain Thor node or a private network.
💡 Tip: Always ensure your custom node supports HTTPS and CORS for mobile app communication.
Environment Management
You can dynamically switch networks at runtime based on environment variables.
Example using react-native-dotenv:
This ensures that your test builds use Testnet and production builds automatically connect to Mainnet.
Last updated
Was this helpful?