Getting started

Register your App

To start using Xact SDK, you will need to Register your Apparrow-up-right in order to get an API Key.

circle-info

Note that a warning will appear on the authorization screens for your app until you apply to be a verified apparrow-up-right.

Step 1: Set up your node.js environment

1.1 Create a new directory for our example

Open your terminal and create a directory named xact-sdk. After you created the project directory navigate into this directory.

mkdir xact-sdk && cd xact-sdk

1.2 Initialize your project

npm init -y

Step 2: Install the Xact SDK

Now that you have your Node environment setup, we can get started with Xact's JS SDK! You can open this project in your favorite text editor like Visual Studio Codearrow-up-right or Webstormarrow-up-right.

1.1 Install it with your favorite package manager

// install Xact's JS SDK with NPM
npm i @xact-wallet-sdk/client@latest

// Install with Yarn
yarn add @xact-wallet-sdk/client@latest

// Install with PNPM
pnpm install @xact-wallet-sdk/client@latest

1.2 Define your environment

Install dotenv with your favorite package manager. This will allow our node environment to use your API key that we will store in a .env file.

Create .env file in your project

The .env file will store your API key. Create this file in the root directory of your project and save it as .env file.

Now you can add your API key provided from your Xact Dev portalarrow-up-right.

Step 3: Create index.js file in the 'root' directory

This file will contain the code we will write in the following samples.

Grab your Xact API key from the .env file.

Step 5: Create you Xact client

circle-exclamation

You haven't the option at this stage to select the Hedera mainnet or testnet. Since we are using an API key generated from the Xact Dev portalarrow-up-right, the environment is already known at this stage.

Let's now initialize the Client with the API key

Then you need to initialize the connection and await for it :

Your project environment is now set up to successfully submit actions through the Xact Walletarrow-up-right!

Next, you will learn how to Login new users.

Code Check ✅

What your index.js file should look like at this point:

Last updated