Installation

About Primus Network-Core-SDK
Network-Core-SDK is a special SDK for builders to integrate with their applications. Unlike the Network-JS-SDK, the Network-Core-SDK does not require the Primus Extension to be installed. This avoids additional steps and user concerns, and can improve the overall user experience in certain scenarios.
Network-Core-SDK does not rely on browser-side features such as network request interception provided by the Primus Extension. While Network-JS-SDK uses these capabilities (after installing the Primus Extension) to act as a zkTLS client and communicate with destination data source servers, Network-Core-SDK instead directly initiate zkTLS protocols directly via configured API endpoints and user credentials.
Based on the fact that user credentials should be configured and stored at the application backend, typical use cases that Network-Core-SDK can work with include
- AI agent program: the agent program can delegate the user to perform transactions and other operations, while zkTLS-based data verification can also be completed by the agent with a pre-configured credential profile.
- Proof-of-Reserve application: asset managers/trading firms can provide verifiable, privacy-preserving proofs on underlying assets and balances, with the goal of further improving transparency and credibility without revealing sensitive data.
Installing the Primus Network-Core-SDK
Welcome to the first step in integrating Primus Network-Core-SDK into your project. This guide will walk you through the installation process and help you get started quickly.
Prerequisites
Before you begin, make sure you have:
- Node.js(version 18 or later)installed on your system
- npm (usually comes with Node.js) or yarn as your package manager
Installation Steps
1. Install the SDK
Open your terminal and navigate to your project directory. Then run one of the following commands:
- Using npm:
npm install --save @primuslabs/network-core-sdk
- Using yarn:
yarn add --save @primuslabs/network-core-sdk
This command will download and install the Primus Network Core SDK and its dependencies into your project.
2. Verify Installation
To ensure the SDK was installed correctly, you can check your package.json file. You should see @primuslabs/network-core-sdk listed in the dependencies section.
Importing the SDK
After installation, you can import the SDK in your JavaScript or TypeScript files. Here's how:
const { PrimusNetwork } = require("@primuslabs/network-core-sdk");
Next Steps
You can refer to the simple example to see an example about how to integrate Network Core SDK into your project.
If you need further support, feel free to reach out through our community on Discord.