JustaName
API ReferenceSDK Reference
Guide
Guide
  • 👋Overview
  • Quickstart
  • Configuration
    • Overview
    • Appearance
    • Allowed ENS Names
    • ENS Domains
    • JustVerified
    • Networks
  • Backend Configuration
    • Overview
    • Sign In Routes
    • Subname Management Routes
    • Full Implementation
  • Learn & Engage
    • Overview
    • Views
    • Filters
  • Plugins
    • Overview
    • JustVerified
    • XMTP
    • EFP
    • POAP
    • Talent Protocol
  • Advanced
    • JustaName Deployment Addresses
    • Coin Types
    • JustaName - Under the Hood
    • Reading JustaName Subname Events from OrbisDB
  • Wallet Providers
    • Overview
    • RainbowKit
    • Para
    • Privy
    • Coinbase Smart Wallet
  • Design Components
    • Logos
  • Use Cases
    • Overview
Powered by GitBook
On this page
  • Specifying Custom Network Options
  • Using Default Network Providers

Was this helpful?

Edit on GitHub
  1. Configuration

Networks

The JustWeb3 Widget allows you to customize the blockchain networks that users can connect to by specifying the chainId and a providerUrl. Currently, the widget supports mainnet (Ethereum Mainnet) and sepolia (Ethereum Testnet). You can configure either one or both networks.

If no network is specified, the widget will use default public RPC URLs for both networks.

Specifying Custom Network Options

To specify a custom network provider, you need to pass the networks array in the widget configuration. Each network should be defined with its chainId and a corresponding providerUrl.

  • Mainnet has a chainId of 1.

  • Sepolia has a chainId of 11155111.

Here’s an example where both mainnet and sepolia are specified with custom provider URLs:

const justweb3Config: JustWeb3ProviderConfig = {
  config: {
    origin: "http://localhost:3000/",
    domain: "localhost",
    signInTtl: 86400000
  },
  networks: [
    { chainId: 1, providerUrl: "YOUR_MAINNET_PROVIDER_URL" },   // Custom Mainnet provider
    { chainId: 11155111, providerUrl: "YOUR_SEPOLIA_PROVIDER_URL" }  // Custom Sepolia provider
  ],
  ...
};

Using Default Network Providers

If you don't specify a network in the configuration, the JustWeb3 Widget will default to public RPC URLs for both mainnet and sepolia. This allows your dApp to function out-of-the-box without requiring a custom provider but might be impacted by the limitations of publoc rpc endpoints.

const justweb3Config: JustWeb3ProviderConfig = {
  config: {
    origin: "http://localhost:3000/",
    domain: "localhost",
    signInTtl: 86400000
  },
  // No networks specified, so the widget will default to public RPC URLs
  ...
};
PreviousJustVerifiedNextOverview

Last updated 7 months ago

Was this helpful?