đŧNode.js
Learn how to integrate Airstack APIs to your Node.js application using the Airstack Node SDK.
đŧ Node.js
In this tutorial, you will learn how to start integrating Airstack API into your Node.js application.
Table Of Contents
Step 0: Pre-requisites
Completed Get API Key
Git
Node v.16+
Step 1: Install Airstack Node SDK
Use a package manager to install the Airstack Node SDK into your Node.js project:
Step 2: Set Environment Variable
Create a new .env
file:
Add the Airstack API key as the environment variable:
If you are using Node version 20.6.0+, then you can simply import the environment variable to you Node.js app. Thus, directly proceed to the next step.
If you are using Node version earlier than 20.6.0, then you need to install the dotenv
package:
and import the package to be able to inject the environment variable to your application:
Step 3: Initialize SDK
You can use init
from the SDK to initialize it with the Airstack API key:
Step 4: Call Your Query
Once you have initialized the SDK, you can use the fetchQuery
to call the Airstack API.
Below you have been provided with Airstack query to fetch the 0x address, Lens, and Farcaster owned by vitalik.eth
:
For more query examples, check out Guides for various use cases you can build with Airstack.
The data
variable will return and logged into your terminal as follows:
Developer Support
If you have any questions or need help regarding integrating Airstack into your Node.js application, please join our Airstack's Telegram group.
More Resources
Learn to build more with Airstack using our tutorials:
Last updated
Was this helpful?