Skip to content

Start typing to search the documentation.

Getting Started

On this page

Installation and Setup

Install the required packages for Self Connect integration:

npm install @celo/identity @celo/abis viem

Required Packages

PackagePurpose
@celo/identityODIS integration and identifier utilities
@celo/abisContract ABIs for FederatedAttestations
viemModern Ethereum library for blockchain interactions

Why Viem?

Self Connect uses Viem as the recommended library for blockchain interactions because:

  • Modern & Type-Safe: Built with TypeScript for excellent type inference
  • Lightweight: Smaller bundle size compared to legacy libraries
  • Modular: Import only what you need
  • Better DX: Cleaner API and better error messages
  • Active Maintenance: Well-maintained with regular updates
  • EIP-1193 Support: Native support for wallet providers

Note: ContractKit is deprecated and no longer recommended for new projects.

Network Configuration

Mainnet:

import { celo } from "viem/chains";

const RPC_URL = "https://forno.celo.org";
const ODIS_CONTEXT = OdisContextName.MAINNET;

Alfajores Testnet:

import { celoAlfajores } from "viem/chains";

const RPC_URL = "https://alfajores-forno.celo-testnet.org";
const ODIS_CONTEXT = OdisContextName.ALFAJORES;
Was this page helpful?