@hoodie/admin-client
v2.0.1
Published
Client Admin API for the Hoodie server
Downloads
3
Readme
hoodie-admin-client
Client Admin API for the Hoodie server
hoodie-admin-client
is currently a simple wrapper around the Hoodie Account’s
admin client.
We plan to add APIs to access users’ data and make the Hoodie Admin Client extendable as the Hoodie Client, but there was no need for yet.
Example
var HoodieAdmin = require('@hoodie/admin-client')
var admin = new HoodieAdmin()
if (!admin.isSignedIn()) {
renderLogin()
} else {
admin.accounts.findAll().then(renderAccounts)
}
admin.accounts.on('change', renderAccounts)
API
Same as AccountAdmin API.
Only difference is that options.url
defaults to location.origin
and AccountAdmin
gets initialised with options.url + '/hoodie/account/api'
.
Testing
Local setup
git clone https://github.com/hoodiehq/hoodie-admin-client.git
cd hoodie-admin-client
npm install
Run all tests
npm test
Contributing
Have a look at the Hoodie project's contribution guidelines. If you want to hang out you can join our Hoodie Community Chat.