npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

robin-js-sdk

v0.5.2

Published

A JavaScript SDK to communicate with the Robin platform.

Downloads

12,265

Readme

Robin JavaScript SDK

A JavaScript SDK to communicate with the Robin platform.

This SDK provides the ability to communicate both with the Robin API and the Robin Grid.

Installation

node

npm install [email protected]:robinpowered/robin-js-sdk.git --save will save this to the dependencies section of your package.json

You may then require this sdk as follows:

var Robin = require('robin-js-sdk');
browser

Include the script from https://static.robinpowered.com/js/sdk/$version/robin.browser.min.js, where $version is the npm version number in package.json. robin-js-sdk will be automatically attached to the window object as window.Robin.

Instantiation

robin-js-sdk is instantiated with two arguments, the first is a Robin Access Token. The second is an optional argument that can be null, a string, an object or undefined.

Options

If the second argument is undefined or null, this SDK will be instantiated with endpoints pointing to production.

If it is a string, it must be a valid robin endpoint. Valid values are test, staging or production. Otherwise an error is thrown.

If it is an object:

  • An empty object will result in all endpoints defaulting to production.
  • If it contains an env property, all endpoints will default to that env. Values other than string types for this property will throw errors.
  • If it has a urls property, then values for core, grid or places will override the default endpoint for any of those apps. Types for this property other than object will throw errors. Properties of this object other than core, grid or places will throw errors.

Robin API

The Robin API is a REST based API. Calls to the API return a promise.

Core API Routes:

| Route | Source | | ------ | -------- | | Accounts | accounts.js | | Apps | apps.js | | Auth | auth.js | | Channels | channels.js | | DeviceManifests | devicemanifests.js | | Devices | devices.js | | Identifiers | identifiers.js | | Locations | locations.js | | Me | me.js | testMe.js | Organizations | organizations.js | | Projects | projects.js | | Spaces | spaces.js | | Triggers | triggers.js | | Users | users.js |

Places API Routes:

| Route | Source | | ------ | -------- | | Events | events.js |

Robin Grid

TODO: Improve this section in a future PR

The Grid is a websocket server that allows PubSub between clients and devices through configured channels. The Grid module is an EventEmitter, to allow real-time updates.

The Grid exposes several modules, which allow you to connect and listen:

  • join - Allows clients to listen to updates from channels
  • leave - Disconnects the client from receiving updates for a particular channel
  • send - Allows a client to send messages to a channel.

Development Roadmap

The following should be implemented:

  • [x] Support for use in browsers, as well as node.js
  • ~~[ ] Add winston for logging - will this work in browsers?~~
  • [x] Handle scope of access tokens for extended functionality (such as retrieving all API items)
  • [ ] Adhere to Robin Javascript Coding Standards - this is TBD.
  • [x] Implement API function arguments based on API documentation
  • [ ] Expand documentation to include all API modules
  • [ ] Can we autogenerate API module functions based on a object template?

Browserify

Running grunt browser generates two files in the browser/ folder.

  • browser/robin.browser.js is the full file after being run through browserify.
  • browser/robin.browser.min.js is the minified version.