ac
account-client
npm i account-client
Deprecated!
account-client is now hoodie-client-account
ac

account-client

An all things client API for the browser

by hoodie

1.0.0 (see all)License:Apache-2.0TypeScript:Not Found
npm i account-client
Readme

account-client

An all things client API for the browser

Build Status Coverage Status Dependency Status devDependency Status

account-client is a JavaScript front-end client for the Account REST API. It presists session information in localStorage and provides front-end friendly APIs for things like creating a user account, confirming, resetting a password, changing profile information, or closing the account.

There is also an admin-specific account client

Example

var account = new Account('https://example.com/account/api')

if (account.isSignedIn()) {
  renderWelcome(account)
}

account.on('signout', redirectToHome)

Full API

var account = new Account(options)
account.username
account.isSignedIn()

account.signUp()
account.confirm()
account.signIn()
account.signOut()
account.request()
account.get()
account.fetch()
account.update()
account.validate()

account.on('signup', handler)
account.on('signin', handler)
account.on('signout', handler)
account.on('update', handler)
account.on('reauthenticated', handler)
account.on('error:unauthenticated', handler)
account.one('signin', handleOnce)
account.off('signin', handler)

See more examples, options, etc at http://hoodiehq.github.io/account-client

Testing

In Node.js

Run all tests and validates JavaScript Code Style using standard

npm test

To run only the tests

npm run test:node

Run tests in browser

test:browser:local

This will start a local server. All tests and coverage will be run at http://localhost:8080/__zuul

Contributing

Have a look at the Hoodie project's contribution guidelines. If you want to hang out you can join our Hoodie Community Chat.

License

Appache 2.0

Downloads/wk

6

GitHub Stars

0
No data available

LAST COMMIT

NaNyrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
No data available
VersionTagPublished
1.0.0
latest
7yrs ago
No alternatives found
No tutorials found
Add a tutorial