Socket
Book a DemoInstallSign in
Socket

@werify/id-ts

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@werify/id-ts

1.2.0
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

Werify Typescript

Simple and lightweight auth service by Werify

Werify

**** First of all set your baseURL using config Object ****

import { werify } from '@werify/id-ts';

// Create the package instance
const authService = werify()

// Now you have access to everything :)
authService.config.baseURL = 'your_baseURL_here'

If you want to use the default endpoints feel free to leave the endpoint parameter in each function

Recommended Stack :

  • Vite
  • Vue or react

Dependencies

  • No dependencies needed

Installation

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

Usage

  • You can import and use all of your required functions
  • all functions return a promise for ease of use
import { werify } from '@werify/id-ts';

// Create the package instance
const authService = werify()

// Use Functions
authService.login('/endpoint', payload).then().catch()

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

Functionmethodparamsdefault endpoint
loginPOSTidentifier/api/v1/v1/login
loginOTPPOSTid, hash, otp/api/v1/v1/otp
getQRSessionGET_/api/v1/v1/qr
checkSessionGET_/api/v1/v1/session-check/model/{hash}/{id}

request user login otp

POST /api/v1/v1/login requires identifier & returns session.

login user with otp

POST /api/v1/v1/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 )

Functionmethodparamsdefault endpoint
getUserProfileGET_/api/v1/v1/user/profile
getUserNumbersGET_/api/v1/v1/user/profile/mobile-numbers
getFinancialInfoGET_/api/v1/v1/user/financial-information
updateUserProfilePUTform data/api/v1/v1/user/profile
addMobileNumberPOSTmobile_number/api/v1/v1/user/mobile-numbers
updateFinancialInfoPUTform data/api/v1/v1/user/financial-information/
getNewModalSessionGET_/api/v1/v1/user/modal
claimModalSessionGET_/api/v1/v1/modal/{hash}/{id}
claimQRSessionGET_/api/v1/v1/qr/{hash}/{id}
checkUsernamePOST_/api/v1/v1/check-username

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.

Keywords

authentication

FAQs

Package last updated on 16 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.