Socket
Socket
Sign inDemoInstall

@koompi/auth

Package Overview
Dependencies
10
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @koompi/auth

This is a client library for interacting with the API of a service called KOOMPI Auth. It provides functions for login, registration, password change, and Google login.


Version published
Weekly downloads
2
Maintainers
1
Install size
33.0 MB
Created
Weekly downloads
 

Readme

Source

KOOMPI Auth

This is a client library for interacting with the API of a service called KOOMPI Auth. It provides functions for login, registration, password change, and Google login.

Installation

To use this library, you need to have Node.js and npm installed on your system. Then, follow these steps:

npm install @koompi/auth
or
yarn add @koompi/auth

Usage

First, import the API client into your JavaScript/TypeScript file:

import auth from "@koompi/auth";
Login

To perform a login operation, use the login function:

auth.login({ email: "user@example.com", password: "password123" })
  .then((data) => {
    // Handle the response data
  })
  .catch((error) => {
    // Handle any errors
  });

Registration

To register a new user, use the register function:

auth.register({
  fullname: "John Doe",
  email: "johndoe@example.com",
  password: "password123",
  confirmPassword: "password123",
})
  .then((data) => {
    // Handle the response data
  })
  .catch((error) => {
    // Handle any errors
  });
Google Login

To perform a login operation using Google, use the loginWithGoogle function:

auth.loginWithGoogle({ tokenId: "googleToken123" })
  .then((data) => {
    // Handle the response data
  })
  .catch((error) => {
    // Handle any errors
  });
Offline Registration (For School Management System)

To register a new user offline, use the offlineRegister function:

auth.offlineRegister({
  firstname: "John",
  lastname: "Doe",
  email: "johndoe@example.com",
  password: "password123",
})
  .then((data) => {
    // Handle the response data
  })
  .catch((error) => {
    // Handle any errors
  });

Change Password

To change the password, use the changePassword function:

auth.changePassword({
  token: "changeToken123",
  password: "newPassword123",
  confirmPassword: "newPassword123",
})
  .then((data) => {
    // Handle the response data
  })
  .catch((error) => {
    // Handle any errors
  });

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please create a new issue or submit a pull request.

License

This project is licensed under the MIT License.

Keywords

FAQs

Last updated on 05 Jul 2023

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc