Giter VIP home page Giter VIP logo

werify-id's Introduction

Werify-ID

Werify

Simple and lightweight auth service

**** 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 :

  1. Vite
  2. Vue or react

Dependencies

  • No dependencies needed

Installation

npm install @werify/werify-id
yarn add @werify/werify-id

Usage

  1. You can import and use all of your required functions
  2. 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()

Public Routes ( Doesn't need any credintials or authorization )


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}

request user login otp

POST /api/login requires identifier & returns session.

login user with otp

POST /api/otp requires id,hash,otp & returns token for user with some info.

get new qr session

GET api/qr/ return qr code session.

check login session ( both qr and modal )

GET api/session-check/modal/{hash}/{id} returns token for user with some info.

Private Routes ( Needs token in request header )


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}

user profile

GET api/user/profile/.

user mobile numbers

GET api/user/profile/mobile-numbers.

user financial informations

GET api/user/financial-information/.

update user profile

PUT api/user/profile/ send fields you want to change.

add new mobile number

POST api/user/mobile-numbers/ send mobile_number field.

update financial information

PUT api/user/mobile-numbers/ send fields you want to change.

get new modal session

GET api/user/modal returns new session for modal and user.

claim modal session

GET api/modal/{hash}/{id} returns new session for modal and user.

claim qr session

GET api/qr/{hash}/{id} returns new session for modal and user.


werify-id's People

Contributors

amomammadw avatar

Stargazers

parsa jiravand avatar

Watchers

MrJosh avatar parsa jiravand avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.