{"id":23550758,"url":"https://github.com/octoblu/node-meshblu-http","last_synced_at":"2026-03-06T19:07:44.925Z","repository":{"id":30420691,"uuid":"33973604","full_name":"octoblu/node-meshblu-http","owner":"octoblu","description":"Meshblu HTTP API","archived":false,"fork":false,"pushed_at":"2018-10-31T19:29:46.000Z","size":170,"stargazers_count":1,"open_issues_count":0,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-28T11:14:13.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"nitrogen-project/android_frameworks_base","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octoblu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-15T04:44:00.000Z","updated_at":"2018-10-31T19:29:48.000Z","dependencies_parsed_at":"2022-09-08T10:41:04.930Z","dependency_job_id":null,"html_url":"https://github.com/octoblu/node-meshblu-http","commit_stats":null,"previous_names":[],"tags_count":106,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoblu%2Fnode-meshblu-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoblu%2Fnode-meshblu-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoblu%2Fnode-meshblu-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoblu%2Fnode-meshblu-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octoblu","download_url":"https://codeload.github.com/octoblu/node-meshblu-http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251302782,"owners_count":21567601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-26T10:17:24.235Z","updated_at":"2026-03-06T19:07:39.892Z","avatar_url":"https://github.com/octoblu.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Meshblu HTTP\nA node package to use the Meshblu HTTP API...\n\n[![Build Status](https://travis-ci.org/octoblu/node-meshblu-http.svg?branch=master)](https://travis-ci.org/octoblu/node-meshblu-http)\n[![Code Climate](https://codeclimate.com/github/octoblu/node-meshblu-http/badges/gpa.svg)](https://codeclimate.com/github/octoblu/node-meshblu-http)\n[![Test Coverage](https://codeclimate.com/github/octoblu/node-meshblu-http/badges/coverage.svg)](https://codeclimate.com/github/octoblu/node-meshblu-http)\n[![npm version](https://badge.fury.io/js/meshblu-http.svg)](http://badge.fury.io/js/meshblu-http)\n[![Gitter](https://badges.gitter.im/octoblu/help.svg)](https://gitter.im/octoblu/help)\n\n# Usage\n### Install:\n```shell\nnpm install --save meshblu-http\n```\n\n### Use:\n```javascript\nvar MeshbluHttp = require('meshblu-http');\n\nvar meshbluHttp = new MeshbluHttp();\n\nmeshbluHttp.register({}, function(error, response) {\n  // code goes here\n})\n```\n\n# Functions\n### Constructor\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| options   | object | no      | can contain any of these keys: bearerToken, uuid, token, hostname, port, protocol, domain, service, secure, resolveSrv, auth |\n------------------------------------------\n```javascript\nvar meshbluHttp = new MeshbluHttp({uuid: 'fancy_uuid', token: 'fancy_token'})\nvar meshbluHttp = new MeshbluHttp({bearerToken: 'some-bearer-token'})\n```\n\n### Authenticate\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.authenticate(function(error, response) {\n  // code goes here\n})\n```\n\n### Create Hook\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid         |\n| type      | string | yes     | a string containing the type         |\n| url       | string | yes     | a string containing the url          |\n| callback  |function| yes     | a function that returns error          |\n------------------------------------------\n```javascript\nmeshbluHttp.createHook('fancy_uuid', 'fancy_token', 'fancy_url', function(error) {\n  // code goes here\n})\n```\n\n### Create Subscription\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| options   | object | yes     | an object containing three keys: subscriberUuid, emitterUuid, and type |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.createSubscription(\n  {\n    subscriberUuid: 'fancy_uuid',\n    emitterUuid: 'another_fancy_uuid',\n    type: 'fancy_type'\n  },\n  function(error, response){\n    // code goes here\n  }\n)\n```\n\n### Delete Subscription\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| options   | object | yes     | an object containing three keys: subscriberUuid, emitterUuid, and type |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.deleteSubscription(\n  {\n    subscriberUuid: 'fancy_uuid',\n    emitterUuid: 'another_fancy_uuid',\n    type: 'fancy_type'\n  },\n  function(error, response){\n    // code goes here\n  }\n)\n```\n\n### Delete Subscriptions\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| options   | object | yes     | an object containing three keys: subscriberUuid, emitterUuid, and type. Type and emitterUuid are optional and will be used to filter the subscriptions to delete. |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.deleteSubscriptions(\n  {\n    subscriberUuid: 'fancy_uuid',\n    emitterUuid: 'another_fancy_uuid',\n    type: 'fancy_type'\n  },\n  function(error, response){\n    // code goes here\n  }\n)\n```\n\n### Device\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid of the device |\n| metadata  | object | no      | an object containing metadata information |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.device('fancy_uuid', {as: 'another_user_uuid'}, function(error, response){\n  // code goes here\n})\n```\n\n### Devices\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| query     | object | no      | an object containing the keys you want to search for |\n| metadata  | object | no      | an object containing metadata information |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.devices({type: 'drone'}, {as: 'another_user_uuid'}, function(error, response){\n  // code goes here\n})\n```\n\n### Find And Update\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid of the device |\n| params    | object | yes     | an object containing the new changes to the device |\n| metadata  | object | no      | an object containing metadata information |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.findAndUpdate('fancy_uuid', {type: 'new-type'}, function(error, response){\n  // code goes here\n})\n```\n\n### Generate And Store Token\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid of the device |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.generateAndStoreToken('fancy_uuid', function(error, response){\n  // code goes here\n})\n```\n\n### Generate And Store Token With Options\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid of the device |\n| options   | object | no      | an object containing the options for the token |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.generateAndStoreTokenWithOptions('fancy_uuid', {expiresOn: '1485452874'},\n  function(error, response){\n    // code goes here\n  }\n)\n```\n\n### Generate Key Pair\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| none      |  |      |          |\n------------------------------------------\n```javascript\nmeshbluHttp.generateKeyPair()\n```\n\n### Health Check\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| callback  |function| yes     | a function that returns error, healthy, and code |\n------------------------------------------\n```javascript\nmeshbluHttp.healthcheck(function(error, healthy, code){\n  // code goes here\n})\n```\n\n### Message\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| message   | object | yes     | an object containing the message to send |\n| metadata  | object | no      | an object containing metadata information |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.message({data: 'hello_message'}, function(error, response){\n  // code goes here\n})\n```\n\n### My Devices\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| query     | object | no      | an object containing your query      |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.mydevices({type: 'drone'}, function(error, response){\n  // code goes here\n})\n```\n\n### Public Key\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid of the device |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.publicKey('fancy_uuid', function(error, response){\n  // code goes here\n})\n```\n\n### Register\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| options   | object | yes     | an object containing properties that you would like your device to have. Can be empty object|\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.register({color: 'blue'}, function(error, response){\n  // code goes here\n})\n```\n\n### Reset Token\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid of the device |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.resetToken('fancy_uuid', function(error, response){\n  // code goes here\n})\n```\n\n### Revoke Token\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid of the device |\n| token     | string | yes     | a string containing the token of the device |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.revokeToken('fancy_uuid', 'fancy_token', function(error, response){\n  // code goes here\n})\n```\n\n### Revoke Token By Query\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid of the device |\n| query     | object | yes     | an object containing your query      |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.revokeTokenByQuery('fancy_uuid', {expiresOn: '1485452874'},\n  function(error, response){\n    // code goes here\n  }\n)\n```\n\n### Search\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| query     | object | yes     | an object containing your query      |\n| metadata  | object | yes     | an object containing metadata information. Can be left empty |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.search({type: 'drone'}, {as: 'another_uuid'},\n  function(error, response){\n    // code goes here\n  }\n)\n```\n\n### Search Tokens\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| query     | object | yes     | an object containing your query      |\n| metadata  | object | yes     | an object containing metadata information. Can be left empty |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.searchTokens({expiresOn: '1485452874'}, {as: 'another_uuid'},\n  function(error, response){\n    // code goes here\n  }\n)\n```\n\n### Set Private Key\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| privateKey| string/object | yes     | a string or object containing your privateKey  |\n------------------------------------------\n```javascript\nmeshbluHttp.setPrivateKey(privateKey)\n```\n\n### Sign\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| data      | object | yes     | an object containing the data you want to sign your privateKey with |\n------------------------------------------\n```javascript\nmeshbluHttp.sign(data)\n```\n\n### Subscriptions\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid of the device |\n| metadata  | object | no      | an object containing metadata information |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.subscriptions('fancy_uuid', {as: 'another_uuid'},\n  function(error, response){\n    // code goes here\n  }\n)\n```\n\n### Unregister\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| device    | object | yes     | an object containing the device credentials |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.unregister({uuid: 'abc', token: 'asd'}, function(error, response){\n  // code goes here\n})\n```\n\n### Update\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| uuid      | string | yes     | a string containing the uuid         |\n| params    | object | yes     | an object containing the new changes to the device |\n| metadata  | object | no      | an object containing metadata information |\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.update('fancy_uuid', {color: 'green'}, function(error, response){\n  // code goes here\n})\n```\n\n### Verify\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| message   | string/object | yes     | data for encrypting                  |\n| signature | string | yes     | this can be obtained from sign()     |\n------------------------------------------\n```javascript\nmeshbluHttp.verify(message, signature)\n```\n\n### Whoami\n| Parameter | Type   | Required| Description                          |\n| ----------| -------| --------| -------------------------------------|\n| callback  |function| yes     | a function that returns error and response |\n------------------------------------------\n```javascript\nmeshbluHttp.whoami(function(error, response){\n  // code goes here\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoblu%2Fnode-meshblu-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctoblu%2Fnode-meshblu-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoblu%2Fnode-meshblu-http/lists"}