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
  1. Getting started
  2. Javascript

Authentication

This is only required for making changes to your Cluster. Querying does not require authentication.

  1. Get signing message

  2. Sign the message with an EVM or Solana wallet

  3. Get authentication key with the signature of the signed message

  4. Using authenticate key with endpoints that require wallet authentication


Get Signing Message

Get the signing message used for wallet signature authentication

Example

const data = await clusters.getAuthMessage()

Response

The message to sign and the corresponding signing date

{
  "message": "clusters.xyz verification\n\nBefore interacting with certain functionality, we require a wallet signature for verification.\n\n2024-05-14T19:08:27.985Z",
  "signingDate": "2024-05-14T19:08:27.985Z"
}

Get Authentication Token

Authenticate the ownership of a specific wallet

Name
Description

signature

Signed message signature

signingDate

Date given by signing message response

type

evm or solana (wallet type used for signing)

wallet

Wallet that signed the message

Example

const data = await clusters.getAuthToken(
    '0x0000000000000000000000000000000000000001',
    '2025-03-26T14:56:07.601Z',
    'evm',
    '0x5cff9c1362a71247da33887be2a44ac36a8724bb',
);

Response

The auth key used for authenticated responses

{
  "token": "eyJzaWduYXR1cmUiOiJhYmMxMjMiLCJzaWduaW5nRGF0ZSI6IjIwMjQtMDUtMTRUMTk6MDg6MjcuOTg1WiIsInR5cGUiOiJldm0iLCJ3YWxsZXQiOiIweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAifQ=="
}

Validate Authentication Token

Authenticate if a authentication key is valid or not

Name
Description

authToken

Authentication token

Example

const check = await clusters.validateAuthToken(authToken)

Response

The auth key used for authenticated responses

{
  "signature": "abc123",
  "signingDate": "2024-05-14T19:08:27.985Z",
  "type": "evm",
  "wallet": "0x0000000000000000000000000000000000000000",
  "isValid": false
}
PreviousJavascriptNextClusters

Last updated 1 month ago