Developers
DevelopersGuides
  • Introducing Bond
    • Introduction
    • Why we build Bond?
    • Roles In Bond Ecosystem
    • Decentralised Relations/Social Graph
    • Architecture
    • Bond Reward Model
      • Leech Principle
      • Barrel Principle
  • Main Concepts
    • Bond Profile
      • Identity
      • Relationships
      • Content
      • Creator Economy
    • Connection
      • Connection NFTs
    • Bond Social Graph
    • Centralities
      • In/Out Degree Centrality
      • Betweenness Centrality
      • Closeness Centrality
      • PageRank Centrality
    • Reward Models
    • Reward Contracts
    • Off-chain Oracles
    • Gasless Mode
    • Cross Chain Messaging and Pay Gas with Bond Token
  • Bond API
    • Introduction
    • API Urls
    • Getting started with GraphQL
    • Authentication
      • Login
      • Refresh JWT
    • Profile
      • Create Profile
      • SetProfileMetadata
    • Connect
      • Connect a profile
      • Disconnect
  • Smart Contracts
    • BondHub
    • MerkelDistributor
    • TokenDeployer
    • SingleStakePoolDeployer
    • LzTokenDeployer
    • LzSingleStakePoolDeployer
  • Bond SDK
    • Bond JS SDK
      • Authenticate
      • Create Profile
      • Connect
  • Bond Nodes
    • Hardware Requirements
    • Set up and Deploy
    • Node Config (TOML)
    • Secrets Config (TOML)
    • Role-Based Access Control (RBAC)
  • References
    • Deployed Contracts
    • Github
Powered by GitBook
On this page
  • Installation
  • Basic Usage
  • Parameters
  1. Bond SDK

Bond JS SDK

The Bond JS SDK is designed for developers looking to connect with the Bond.network. It's built with TypeScript, making it simpler to interact with our APIs. With the SDK, you don't need to handle the GraphQL details. Instead, you can focus on building and integrating features, ensuring users can easily manage their social data and identities across platforms.

The SDK version is currently in beta, the namespace will probably change later

Installation

To install the package, simply run:

npm install @bondlab/client
yarn add @bondlab/client

Basic Usage

Initialise the client with the preferred environment and options.

import BondHub, { Env, Blockchain } from '@bondlab/client'

const bondHUb = new BondHub({
  appId: '1',
  apiKey: '3635df8e-419f-11ee-be56-0242ac120002',
  env: Env.Production,
  chain: Blockchain.POLYGON,
  provider: provider
})

Parameters

  • appId - the app id you obtained from bond project management platform after you create your project

  • apiKey- the api key you obtained from bond project management platform from after you create your project

  • env - (optional) Env chooses the endpoints. We have staging and production. (The default value is Env.Production).

  • chain - (optional) The blockchain you want to connect with. Now we support POLYGON

  • provider - The corresponding web3 provider of the given chain.

PreviousLzSingleStakePoolDeployerNextAuthenticate

Last updated 1 year ago