Welcome to Dev3
  • ➕Create a Dev3 App
  • 🤖SDK
    • 📖Introduction
    • ⚙️Initialization
    • ➡️Importing Contracts
    • 🤝User Authentication
      • Options
    • 🔍Query Contracts
      • Function Parameters
    • ⚡Execute Contracts
      • Execution Options
    • 🛠️Deploy Contracts
      • Deployment Options
    • 📖Address Book
    • ❓FAQ
      • Out of gas error
  • INTEGRATIONS
    • 🔷Chainlink Feeds
    • 🔷Chainlink Subscriptions
      • 🎲VRF Subscriptions
      • 🧮Functions Subscriptions
      • 🤖Upkeep Subscriptions
    • 🎆OriginTrail DKG
    • 📽️OriginTrail DKG Video Tutorial
    • 📊Polyflow Analytics
  • Pricing
    • 💸Dev3 Pricing Plans
    • 💸Polyflow Pricing Plans
  • 🚀Guides
    • 👾Launching an NFT Collection
      • Step 1: Upload assets
      • Step 2: Upload metadata
      • Step 3: Deploy contracts
  • 🏫Resources
    • 👨‍💻Developer Resources
Powered by GitBook
On this page
  • 1. Get API key
  • 2. Install SDK
  • 3. Initialize SDK
  • Live example
  1. SDK

Initialization

How to install and connect Dev3 SDK.

PreviousIntroductionNextImporting Contracts

Last updated 2 years ago

The SDK can be installed within your project by following three straightforward steps:

  1. Read your API key from the Dev3 Dashboard

  2. Install the NPM package

  3. Initialize the main SDK object

This usually takes up to 10 minutes, taking into the account that you have already built your first project on the Dev3 Dashboard. The steps are explained in the detail below.

1. Get API key

Before integrating the SDK make sure you've visited the and created your project as the project contains secrets required to initialize the SDK properly.

If you're having trouble creating the project, please refer to the Welcome to Dev3 docs where you can learn how to easily create your first project in minutes, all followed by the screenshots!

Once your project is initialized, go to the Project Dashboard - home screen presented when you open the project page. Here, you'll find two secret values: project-id and api-key, as shown below:

2. Install SDK

To install the SDK within your project, simply run:

npm install dev3-sdk

3. Initialize SDK

import { Dev3SDK } from 'dev3-sdk';
// or:
// const { Dev3SDK } = require('dev3-sdk');

const sdk = new Dev3SDK(
    "<api-key-from-the-dashboard>",
    "<project-id-from-the-dashboard>"
);

And you're basically done. To check if the connection is successful, you can always run a test command, for example fetch a list of deployable contracts offered by the Dev3 platform:

const deployableContracts = await sdk.getManifests();
console.log("deployable contracts", deployableContracts);

Live example

Somewhere in your code, create the main SDK object which you're going to use for all the interactions, by providing the api-key and project-id values obtained in .

Run this flow on a live coding environment

🤖
⚙️
here!
step 1
Dev3 Dashboard