Configuration
Configure the Self SDK to work with your infrastructure.
Configuration Options
-
The SDK accepts the following configuration options when initializing:
export interface ResolverOptions { rpcUrl?: string ipfsGateway?: string }
Default Values
-
If not specified, the SDK uses these defaults:
const defaultConfig = { rpcUrl: 'https://bsc-dataseed1.binance.org/', ipfsGateway: 'https://ipfs.io/ipfs/', }
Production Configuration
-
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 })
Using default public RPC and IPFS endpoints may lead to rate limiting in production. We strongly recommend using dedicated endpoints for production deployments.
Environment-based Configuration
-
Example of environment-based configuration:
const sdk = new SelfSDK({ rpcUrl: process.env.RPC_URL, ipfsGateway: process.env.IPFS_GATEWAY, })