LogoLogo
$THX tokenDiscord Community
  • THX Network
  • 🏗️Campaign Managers
    • Getting Started
    • Analytics
    • Quests
      • Daily Quests
      • Invite Quests
      • Twitter Quests
      • Discord Quests
      • Custom Quests
      • Web3 Quests
      • Webhook Quests
      • Steam Quests
      • Quest Locks
    • Rewards
      • Coin Rewards
      • NFT Rewards
      • Custom Rewards
      • Coupon Rewards
      • Discord Role Rewards
    • Participants
    • Integrations
      • Discord
      • Twitter, now X
      • Gitcoin Passport
    • Coins
    • NFT
  • 🧑‍🤝‍🧑USERS
    • Memberships (Free)
    • Lottery (Free)
  • 💡FAQ
    • Pricing
    • Multi Wallet Account
    • Points
    • Other
  • 💻Developers
    • HTML Widget
    • JS SDK
      • Identity
      • Events
    • API
      • API Specification
      • Example
    • Webhooks
    • QR codes
    • Audits
  • 🪙Tokenomics
    • $THX
    • Locking $THX to $veTHX
    • Increasing Locked $veTHX
    • Protocol
    • Token Distribution
  • 🤝ABOUT
    • Team
    • One Pager
    • Community
Powered by GitBook
On this page

Was this helpful?

  1. Developers

JS SDK

Created Identities and register Events in your application using `THXAPIClient` or rebuild the campaign widget in your own environment using `THXBrowserClient`.

Last updated 9 months ago

Was this helpful?

The SDK allows for an easy implementation of THX API in both browsers and JavaScript backends. Make sure to obtain your API credentials in your campaign dashboard.

THXAPIClient

const { THXAPIClient } = require('@thxnetwork/sdk');

const thx = new THXAPIClient({
    apiKey: '',
});

Create Identity

Identities are unique codes that you can use to allocate event data to. After connecting the Identity to a THX account your users will be able to complete custom quests for this event data.

const identity = await thx.identity.create()
// a6021617-9aab-4194-b2af-a4dd0cc96f84
💻
Identity
Events
npm: @thxnetwork/sdknpm
Download @thxnetwork/sdk on NPM
Example of API keys under Account -> Developer -> API
Logo