npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@werify/id-ts

v1.2.0

Published

Downloads

6

Readme

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 :

  1. Vite
  2. Vue or react

Dependencies

  • No dependencies needed

Installation

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

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/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 )


Function | method | params | default endpoint ---- | ---- | ---- | --- | login| POST | identifier | /api/v1/v1/login loginOTP| POST | id, hash, otp | /api/v1/v1/otp getQRSession| GET | _ | /api/v1/v1/qr checkSession| GET | _ | /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 )


Function | method | params | default endpoint ---- | ---- | ---- | --- | getUserProfile| GET | _ | /api/v1/v1/user/profile getUserNumbers| GET | _ | /api/v1/v1/user/profile/mobile-numbers getFinancialInfo| GET | _ | /api/v1/v1/user/financial-information updateUserProfile| PUT | form data | /api/v1/v1/user/profile addMobileNumber| POST | mobile_number | /api/v1/v1/user/mobile-numbers updateFinancialInfo| PUT | form data | /api/v1/v1/user/financial-information/ getNewModalSession| GET | _ | /api/v1/v1/user/modal claimModalSession| GET | _ | /api/v1/v1/modal/{hash}/{id} claimQRSession| GET | _ | /api/v1/v1/qr/{hash}/{id} checkUsername| POST | _ | /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.