meshblu-http is a Node.js client library for interacting with the Meshblu HTTP API, primarily associated with the Octoblu IoT platform. It provides a programmatic interface for common operations such as device registration, authentication, sending and receiving messages, and managing subscriptions and webhooks. The library is currently at version 10.2.0, with a history of minor and patch releases addressing features like `bearerToken` support and improved subscription management. While the broader Meshblu ecosystem has evolved significantly since 2017 into a microservices architecture (e.g., `meshblu-core-*` components), this client library largely targets the HTTP API of the original Meshblu 1.0 or compatible services. Its API predominantly uses a callback-based pattern, reflecting its origins as a CoffeeScript-driven project. It serves as a high-level abstraction for interacting with IoT devices and services connected to the Meshblu platform via HTTP.
npm install meshblu-httpVerified import paths — ran on the pinned version, not inferred.
This quickstart registers a new device with Meshblu and then authenticates using the newly generated credentials. It demonstrates basic client initialization and a common device lifecycle operation, using environment variables for host configuration.
Consult the official GitHub repository's release notes or commit history for `v10.0.0` and higher to understand specific API changes and adapt your code accordingly. Test thoroughly after upgrading.
Always use `const MeshbluHttp = require('meshblu-http');` for importing the library. If you are developing an ESM project, you may need to use a CommonJS wrapper or a build tool that handles CJS interoperability.For new projects, consider whether `meshblu-http` aligns with the current Meshblu architecture or if direct interaction with `meshblu-core` components or other protocol clients would be more appropriate. Verify the active status and support for the specific Meshblu HTTP API endpoint you are targeting.
Ensure that if your Meshblu instance requires authentication for registration, you provide valid `uuid` and `token` in the `MeshbluHttp` constructor, or that the Meshblu server is configured to allow anonymous registration for the `/devices` endpoint. For subsequent authenticated calls, always pass the device's `uuid` and `token`.
Ensure you are using the correct CommonJS import statement: `const MeshbluHttp = require('meshblu-http');`. Do not use `import MeshbluHttp from 'meshblu-http';` or similar ESM syntax.Verify that the Meshblu server is running and listening on the specified hostname and port. Check network connectivity, firewall rules, and ensure the `hostname` and `port` values in the `MeshbluHttp` constructor are correct for your Meshblu instance.
No dependency data recorded yet.