Clusters
  • Introduction
    • Overview
    • Concepts
      • Cluster Name
      • Wallet Name
    • Features
      • Communities
      • Multichain
      • Wallet Bundles
      • Antisquatting
      • Wallet Generation
      • Selective Wallet Sharing
  • Getting started
    • Javascript
      • Authentication
      • Clusters
      • Address → Cluster Name
      • Cluster Name → Address
      • Registration
        • Communities
      • Event Indexing
    • API
      • v1
        • Authentication
        • Clusters
        • Address → Cluster Name
        • Cluster Name → Address
        • Registration
          • Communities
        • Event Indexing
      • v0.1 (Deprecated)
        • Address → Cluster
        • Cluster → Address
        • Cluster → Metadata
        • Registration
        • Managing Wallets
  • Resources
    • Smart Contracts
    • Address Types
    • Using Clusters for ETH->SOL Airdrops
  • Integration Guides
    • Convert hex address to clusters name
    • Registering a name
      • Ethereum Networks
      • Solana
    • Whitelabel Communities Registration Flow
Powered by GitBook
On this page
  • Install the SDK
  • Get an optional API Key
  • Create your Clusters client
  • Helper functions & variables
  1. Getting started

Javascript

Learn how to setup our framework agnostic javascript client

1

Install the SDK

Using npm:

npm install @clustersxyz/sdk viem

Or yarn:

yarn add @clustersxyz/sdk viem
2

Get an optional API Key

You can get an API Key by visiting https://clusters.xyz/developer

3

Create your Clusters client

Import

import { Clusters } from "@clustersxyz/sdk"

// 3 different examples
const clusters = new Clusters();

// with testnet enabled
const clusters = new Clusters({ isTestnet: true }) 

// with api key
const clusters = new Clusters({ apiKey: "abc123" });

Helper functions & variables

validNameRegex

The regex for a valid cluster name

getImageUrl(name)

Get's the profile pfp url of a specific cluster name

getProfileUrl(name)

Get's the profile url of a cluster name

normalizeName(name)

Will clean up the name for onchain submission

isNameValid(name)

Checks if the name is a valid name and will be accepted on chain

PreviousSelective Wallet SharingNextAuthentication

Last updated 2 months ago