useauthrocket
v1.0.8
Published
an authentication system for your reactjs applications
Downloads
2
Maintainers
Readme
authrocket
Installation
npm install useauthrocket
Usage
import Authrocket from 'useauthrocket'
const app = Authrocket.initializeApp({
apiKey: <your api key>,
appName: <your app name>
})
Visit authrocket website to generate an api key. appName is the name of your application and can be anything
Available methods
- createAccount
accepts
:- email (string)
- password (string)
- payload (object)(optional)
returns
: object
const user = app.createAccount(<email>, <password>, <payload>)
- login
accepts
:- email (string)
- password (string)
returns
: object
const user = app.login(<email>, <password>)
- getUser
accepts
:- uuid (string)
returns
: object
const user = app.getUser(<uuid>)
- isEmailVerified
accepts
:- uuid (string)
returns
: boolean
const isEmailVerified = app.isEmailVerified(<uuid>)
- isUserLoggedIn
accepts
:- uuid (string)
returns
: boolean
const isUserSignedIn = app.isUserSignedIn(<uuid>)
- signout
app.signout()