1.0.11 • Published 6 months ago

@pr4j3sh/auth v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

pr4j3sh/auth

pr4j3sh/auth is an authentication service that enables user registration, login, and profile access. With our SDKs, developers can easily integrate authentication into their own applications.

limited to 10 req/min/user

Documentation

Website | Documentation

Installation

npm i @pr4j3sh/auth

Usage

SDK

Client side

  • User Registration
import auth from "@pr4j3sh/auth";

const payload = {
  username: "johndoe",
  password: "securepassword123",
};

const res = await auth.register(payload);
console.log(res);

Server side

const { authHandler } = require("@pr4j3sh/auth");

app.get("/protected", authHandler, (req, res) => {
  res.json({ user: req.user });
});

Curl

  • User registration
curl -X POST https://pr4j3sh-auth.up.railway.app/api/auth/register -H 'Content-Type: application/json' -d '{"username":"john", "password":"123456"}'

returns JWT token

References

1.0.11

6 months ago

1.0.10

6 months ago

1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.4

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago