This repository contains the files required to run the Helicon Node Quickstart.
Helicon is a simple, scalable, robust, code-free and generic platform to enable and productise the next generation of "online modified", real-time event stream ML/AI models.
Project can be setup with those simple steps:
- locally download the repository
- install the necessary dependencies with
npm install
(or any package manager you prefer, likeyarn
orpnpm
).
publish operations can be performed by using the HeliconWriteClient
class exported by the library.
To initialize a new HeliconWriteClient
instance, the user is tasked to fill all the required parameters of the constructor such as:
- The address where the GRPC Host is located
- The port to which the GRPC Host is binded
- The rest of the authentication parameters such as Client Secret, clientId and Tenant
Each of these parameters can be found (pre-filled) in the "Setup" section of a newly created stream.
After a HeliconWriteClient
has been initialized, the user can send data to the stream thanks to the write(streamName, payload)
method; An usage example is shown below:
const { HeliconWriteClient } = require("@radicalbit/helicon-node-sdk");
const host = "<host>";
const port = 443;
const clientId = "<client-id>";
const clientSecret = "<client-secret>";
const tenant = "<tenant-name>";
const payload = {
"name": "record",
"temperature": 29
};
const heliconWriteClient = new HeliconWriteClient(host, clientId, clientSecret, tenant, port);
subscribe operations can be performed by using the HeliconSubscribeClient
class exported by the library.
To initialize a new HeliconSubscribeClient
instance, the user is tasked to fill all the required parameters of the constructor such as:
- The address where the GRPC Host is located
- The port to which the GRPC Host is binded
- The rest of the authentication parameters such as Client Secret, clientId and Tenant
Each of these parameters can be found (pre-filled) in the "Setup" section of a newly created stream.
After a HeliconSubscribeClient
has been initialized, the user can receive the events from the stream thanks to the subscribe(streamDisplaName)
method; An usage example is shown below:
const { HeliconSubscribeClient } = require("@radicalbit/helicon-node-sdk");
const host = "<host>";
const port = 443;
const clientId = "<client-id>";
const clientSecret = "<client-secret>";
const tenant = "<tenant-name>";
const heliconSubscribeClient = new HeliconSubscribeClient(host, clientId, clientSecret, tenant, port);
heliconSubscribeClient.subscribe("<streamName>").onData(
(data) => console.log(data)
);
If you want to run the app locally, you will need to:
- fill the necessary authentication details in
publish.js
orsubscribe.js
. - Run the examples with
npm run start:publish
ornpm run start:subscribe
(you can useyarn
orpnpm
too)
The main branch is always updated with the latest version of Helicon API.
If you need to use an old version of the Helicon's API, you can switch between the project version using git checkout tag_version
.
You can refer to Helicon documentation for looking more in the depth over the version's features.
We're always happy to help with any other questions you might have! Send us an email.