Skip to main content
In this JavaScript quickstart we will learn how to:
  • Install the Gateway SDK
  • Creating a Gateway Client
  • Interacting with the Protocol for various operations
1

Install @gateway-dao/sdk

First begin by installing the @gateway-dao/sdk package.
2

Setup the Gateway Client

You will need an API Key and Bearer token to authenticate with the Gateway Protocol. You can obtain these from the Gateway Dashboard.To setup the gateway client we will authenticate with a bearer-token and a Api key as follows:
Node.js
Make sure you add token without “Bearer” word as we add Bearer automatically when you make request. Else it will give you Unauthorized error even if your token is correct.
Do not share your authentication token with people you don’t trust. This gives the user control over your account and they will be able to manage PDAs (and more) with it. Use environment variables to keep it safe.
3

Interacting with the Gateway Protocol

Now that we have setup the Gateway Client, we can interact with the Gateway Protocol for various operations.

Create a PDA

Node.js