Skip to main content
The peaq SDKs cover DID, RBAC, and Storage operations on peaq chain, in JavaScript and Python. For the full API, see the SDK Reference.

JavaScript

Prerequisite: Node.js 18 or later.
1

Create a Node.js project

Run npm init -y to create a Node.js project.
2

Install the SDK

3

Enable ES Modules

In package.json, add "type": "module".
4

Write and run your code

Put your SDK code in a .js file and run it with node file_name.js.
For what the JavaScript SDK can do, see the JavaScript SDK Reference.

Python

Prerequisite: Python 3.10 or later.
1

Set up a virtual environment

Mac/Linux:
Windows:
2

Install the SDK

The examples on these pages are written for version 0.2.1, and the 1.x API differs, so pin the version to run them as written.
3

Add environment variable support

The reference examples read their keys and URLs from a .env file. Add python-dotenv==1.1.0 to requirements.txt and install it with pip install -r requirements.txt.
4

Write and run your code

Put your SDK code in a .py file and run it with python file_name.py.
For what the Python SDK can do, see the Python SDK Reference.