Docs of Communities ID
WebsiteTwitterDiscord
  • What is Communities ID
  • DID as a Service
    • Omni DID
    • Bridge DID
    • Soulbound DID
  • Why "DID as a Service"?
  • How to start?
    • For project owners
    • For regular users
  • Terminology
  • Pricing & Business Model
    • Business Model
    • Pricing Policy
  • Frequently Asked Questions
  • -BRAND GUIDE-
    • Community Settings
    • Mint Settings
      • Mint Mode
      • Pricing
      • Base URL (PFP)
    • Renewal & Expiration
  • -USER GUIDE-
    • Mint
    • Burn
    • Renewal & Expiration
    • Set as Primary
    • Soulbound
  • -Developers-
    • SDK
      • Overview
        • Install & Initialize
        • Search Brand/User
        • Resolving Name
        • Modify User DID
      • API reference
        • Collector
        • Resolver
        • Operator
  • - Legal -
    • Privacy Policy
    • Terms of Service
Powered by GitBook
On this page
  1. -Developers-
  2. SDK
  3. Overview

Install & Initialize

import CommunitiesID from '@communitiesid/id';

const OPTIONS: CommunitiesIDInput = {
  isTestnet: false,
  openseaKey: '<Your opensea api key>',
  Ethereum: {
    RPCUrl: '<Your rpc url for this chain>'
    // generateSign is required to call writing methods, like mint, renew
    generateSigner: provider => new ethers.Wallet(process.env.PRIVATE_KEY || '', provider)
  },
  Polygon: {
    RPCUrl: '<Your rpc url for this chain>'
  },
  Base: {
    RPCUrl: '<Your rpc url for this chain>'
  },
  OP: {
    RPCUrl: '<Your rpc url for this chain>'
  },
  BSC: {
    RPCUrl: '<Your rpc url for this chain>'
  },
  Scroll: {
    RPCUrl: '<Your rpc url for this chain>'
  },
  // This is for resolve name for space id only
  arbitrum: {
    RPCUrl: '<Your rpc url for this chain>'
  },
}

const { resolver, collector, operator } = new CommunitiesID(options);

You can also initialize it with provider (except arbitrum, because it is only used for resolve name for space id)

const OPTIONS: CommunitiesIDInput = {
  isTestnet: false,
  openseaKey: '<Your opensea api key>',
  Ethereum: {
    provider: new ethers.providers.JsonRpcProvider('xxx')
  },
  ...
}

If you want to use this sdk on communitiesID testnet, you can initialize it like this:

const OPTIONS: CommunitiesIDInput = {
  isTestnet: true,
  ...
}
PreviousOverviewNextSearch Brand/User

Last updated 1 year ago