Continuum Bridge Client

raw JSON →
0.0.1 verified Sat Apr 25 auth: no javascript

The Continuum Bridge Client package is a development library for Raspberry Pi devices interacting with the Continuum Bridge platform (stable version 0.0.1, early development stage). It provides tools to interface with bridge components, handling communication and data exchange. Differentiators include minimal dependencies and direct Raspberry Pi GPIO integration. Release cadence is irregular as it's a prototype. Alternatives include platform-specific SDKs like AWS IoT or Azure IoT Edge.

error Cannot find module 'client'
cause Package not installed or installed globally without local node_modules.
fix
Run npm install client --save in project directory, or check NODE_PATH.
error TypeError: client.connect is not a function
cause Using default import instead of named import for Client class.
fix
Use const { Client } = require('client') instead of const Client = require('client').
error Error: EACCES: permission denied, open '/sys/class/gpio/export'
cause User lacks permission to access GPIO on Raspberry Pi.
fix
Run script with sudo, or add user to gpio group and reboot.
gotcha Package is in early development (pre-1.0.0) — API may change without notice.
fix Pin to exact version and expect breaking changes.
breaking Requires Node.js 12+ (engines field is *, but actually needs ES2017 features).
fix Use Node.js 12 or newer; older versions may fail with syntax errors.
gotcha No default export; must use named exports const { Client } = require('client').
fix Use destructuring or require('client').Client.
gotcha On Raspberry Pi, GPIO access requires running as root or with sudo.
fix Run script with sudo or add user to gpio group.
npm install client
yarn add client
pnpm add client

Shows how to require the package, instantiate the client, connect, and send periodic data.

const { Client, config } = require('client');
const client = new Client({ apiKey: process.env.API_KEY ?? '' });
client.connect()
  .then(() => console.log('Connected'))
  .catch(err => console.error(err));
setInterval(() => client.send({ temp: 22.5 }), 5000);