Getting started
Register your App
To start using Xact SDK, you will need to Register your App in order to get an API Key.
Note that a warning will appear on the authorization screens for your app until you apply to be a verified app.
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.
1.2 Initialize your project
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 Code or Webstorm.
1.1 Install it with your favorite package manager
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 portal.
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
Note that the API key is directly linked to a unique environment.
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 portal, 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 Wallet!
Next, you will learn how to Login new users.
Code Check ✅
What your index.js file should look like at this point:
Last updated