**** First of all set your baseURL using config
Object ****
import { werify } from '@werify/werify-id';
// Create the package instance
const authService = werify()
// Now you have access to everything :)
authService.config.baseURL = 'your_baseURL_here'
Recommended Stack :
- Vite
- Vue or react
- No dependencies needed
npm install @werify/werify-id
yarn add @werify/werify-id
- You can import and use all of your required functions
- all functions return a promise for ease of use
import { werify } from '@werify/werify-id';
// Create the package instance
const authService = werify()
// Use Functions
authService.login('/endpoint', payload).then().catch()
Function | method | params | default endpoint |
---|---|---|---|
login | POST | identifier | /api/login |
loginOTP | POST | id, hash, otp | /api/otp |
getQRSession | GET | _ | /api/qr |
checkSession | GET | _ | /api/session-check/model/{hash}/{id} |
POST /api/login
requires identifier
& returns session.
POST /api/otp
requires id
,hash
,otp
& returns token for user with some info.
GET api/qr/
return qr code session.
GET api/session-check/modal/{hash}/{id}
returns token for user with some info.
Function | method | params | default endpoint |
---|---|---|---|
getUserProfile | GET | _ | /api/user/profile |
getUserNumbers | GET | _ | /api/user/profile/mobile-numbers |
getFinancialInfo | GET | _ | /api/user/financial-information |
updateUserProfile | PUT | form data | /api/user/profile |
addMobileNumber | POST | mobile_number | /api/user/mobile-numbers |
updateFinancialInfo | PUT | form data | /api/user/financial-information/ |
getNewModalSession | GET | _ | /api/user/modal |
claimModalSession | GET | _ | /api/modal/{hash}/{id} |
claimQRSession | GET | _ | /api/qr/{hash}/{id} |
GET api/user/profile/
.
GET api/user/profile/mobile-numbers
.
GET api/user/financial-information/
.
PUT api/user/profile/
send fields you want to change.
POST api/user/mobile-numbers/
send mobile_number
field.
PUT api/user/mobile-numbers/
send fields you want to change.
GET api/user/modal
returns new session for modal and user.
GET api/modal/{hash}/{id}
returns new session for modal and user.
GET api/qr/{hash}/{id}
returns new session for modal and user.