Overview
Installation
Section titled “Installation”Globe Tracker has its own internal dedicated flowcore cluster and therefore can all the flowcore SDKs be used directly.
Getting a Flowcore Account
Section titled “Getting a Flowcore Account”Prerequisite: You need a GitHub account to sign up for Flowcore. If you do not have one, please create a GitHub account first at github.com/join.
To use the Flowcore CLI or API, you need an account on flowcore.io. The account is free to use. You can sign up directly on the website. Access to Globe Tracker data must be granted by Globe Tracker—contact your Globe Tracker representative to request access. Example data is open, but your own data requires explicit access.
Retrieving IoT Data with @flowcore/data-pump
Section titled “Retrieving IoT Data with @flowcore/data-pump”The @flowcore/data-pump package provides a high-performance way to stream and process IoT data from Flowcore in Node.js, Deno, or Bun environments.
Installation
Section titled “Installation”Install the package using your preferred package manager:
npm install jsr:@flowcore/data-pump# oryarn add jsr:@flowcore/data-pump# orpnpm i jsr:@flowcore/data-pumpYou will also need the OIDC client for authentication:
npm install jsr:@flowcore/oidc-clientUsage Example
Section titled “Usage Example”Below is a minimal example of how to use @flowcore/data-pump to retrieve IoT data. You must provide your authentication credentials and specify the correct tenant, data core, flow type, and event types for your use case.
import { FlowcoreDataPump } from "@flowcore/data-pump";import { oidcClient } from "@flowcore/oidc-client";
const oidc = oidcClient({ clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET",});
const dataPump = FlowcoreDataPump.create({ auth: { getBearerToken: () => oidc.getToken().then(token => token.accessToken), }, dataSource: { tenant: "globe-tracker", // or your assigned tenant dataCore: "YOUR_DATA_CORE", flowType: "YOUR_FLOW_TYPE", eventTypes: ["YOUR_EVENT_TYPE"], }, processor: { concurrency: 1, handler: async (events) => { console.log(`Got ${events.length} events`); // Process your events here return true; }, }, bufferSize: 10000, maxRedeliveryCount: 4, achknowledgeTimeoutMs: 10000, logger: console,});
await dataPump.start((error) => { console.log("Datapump ended with:", error);});Tip: Replace the placeholders with your actual credentials and data source details. For Globe Tracker, use the tenant name
globe-trackerunless instructed otherwise by your representative.
For more advanced usage and configuration, see the @flowcore/data-pump documentation.