The Twin Protocol SDK is a Node.js library that provides seamless integration with the Twin Platform API. This SDK allows developers to easily interact with AI-based twin models and perform other key operations within the Twin Platform Customer Portal.
npm install twin-protocol-prodgit available in your PATH, as npm might need it (You can find git here).
bash
$ sudo apt install nodejs
$ sudo apt install npm
`
- #### Other Operating Systems
You can find more information about the installation on the official Node.js website and the official NPM website.
If the installation was successful, you should be able to run the following commands:
`bash
$ node --version
v20.13.1
$ npm --version
10.5.2
`
Install
`bash
$ npm install twin-protocol-prod
`
Configure environment variables
`bash
TP_ACCESS_KEY
TP_SECRET_KEY
TP_CLIENT_ID
TP_BASE_URL
TP_WS_URL
`
Usage
$3
Steps to initialize the SDK:
`javascript
import TwinProtocol from "twin-protocol-prod";
const _twin = new TwinProtocol({
TP_ACCESS_KEY: "your-access-key",
TP_SECRET_KEY: "your-secret-key",
TP_CLIENT_ID: "your-client-id",
TP_BASE_URL: "your-base-url",
TP_WS_URL: "your-ws-url",
});
``