Configuration

Configure the Self SDK to work with your infrastructure.

Configuration Options

  1. The SDK accepts the following configuration options when initializing:

    export interface ResolverOptions {
      rpcUrl?: string
      ipfsGateway?: string
    }
    

Default Values

  1. If not specified, the SDK uses these defaults:

    const defaultConfig = {
      rpcUrl: 'https://bsc-dataseed1.binance.org/',
      ipfsGateway: 'https://ipfs.io/ipfs/',
    }
    

Production Configuration

  1. For production environments, we recommend using dedicated endpoints:

    const sdk = new SelfSDK({
      rpcUrl: 'YOUR_DEDICATED_RPC_URL', // Use a dedicated RPC provider
      ipfsGateway: 'YOUR_IPFS_GATEWAY', // Use a dedicated IPFS gateway
    })
    

Environment-based Configuration

  1. Example of environment-based configuration:

    const sdk = new SelfSDK({
      rpcUrl: process.env.RPC_URL,
      ipfsGateway: process.env.IPFS_GATEWAY,
    })