commit | 88fe2dba6544e93675f46c62b89a0ae43562aaa0 | [log] [tgz] |
---|---|---|
author | brandon <brandon@behemoth.ca> | Thu Jan 14 14:02:07 2016 -0800 |
committer | brandon <brandon@behemoth.ca> | Thu Jan 14 14:02:07 2016 -0800 |
tree | 5613be8056f29ba6f84fd05044c335e9effffef4 | |
parent | 65f77690265a8b73b2ccf9e84e82b162efa293fd [diff] |
Added ad-hoc authentication to UsergridClient, fixed some false-positive shared instance-based tests - UsergridAuth now supports token-based init via new UsergridAuth(token) - Added UsergridClient.usingAuth(auth) method and .tempAuth for ad-hoc authentication - Fixed several methods that inadvertently defaulted to using the Usergrid shared instance. Further testing required.
Node.js SDK 2.0 for Usergrid
Currently a work in progress; documentation and implementation are subject to change.
Release Candidate 0, available here or on npm
Please open an issue
To install the latest stable build:
npm install usergrid
To install the 2.0 release candidates, install from npm, specifying the version ~2.0.0-rc
:
npm install usergrid@~2.0.0-rc
(Or add usergrid: ~2.0.0-rc
to your package.json)
If you want access to the latest development build (you will need to run npm install
to keep it up to date):
npm install r3mus/usergrid-nodejs
Note: This section is left intentionally light. In its current release candidate state, this SDK is only recommended for developers familiar with Usergrid, Node.js, and preferably Mocha tests. For full usage and implementation, have a look in /tests
.
There are two fundamental ways to use the new Node SDK:
Singleton pattern:
var Usergrid = require('usergrid') Usergrid.init({ orgId: ..., appId: ... } // or from a config file, see config.sample.json var Usergrid = require('usergrid') Usergrid.init() // defaults to use config.json
Instance pattern (primarily used when connecting to multiple Usergrid targets):
var UsergridClient = require('./node_modules/usergrid/lib/client') var client = new UsergridClient(config)