Skip to content

Overview

Globe Tracker has its own internal dedicated flowcore cluster and therefore can all the flowcore SDKs be used directly.

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.

Install the package using your preferred package manager:

Terminal window
npm install jsr:@flowcore/data-pump
# or
yarn add jsr:@flowcore/data-pump
# or
pnpm i jsr:@flowcore/data-pump

You will also need the OIDC client for authentication:

Terminal window
npm install jsr:@flowcore/oidc-client

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-tracker unless instructed otherwise by your representative.

For more advanced usage and configuration, see the @flowcore/data-pump documentation.