npm install useauthrocket
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
- 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()