simple-jwt-login
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

Banner

npm downloads

Simple-JWT-Login SDK

This is a basic SDK for the Simple-JWT-Login WordPress plugin. This SDK allows you to create an easy integration for your App and your WordPress instance.

Installation

npm install "simple-jwt-login"

or

yarn add "simple-jwt-login"

Usage

import { SimpleJwtLogin, RegisterUserInterface } from "simple-jwt-login";

let params: RegisterUserInterface;

params = {
  email: "me@mydomain.com",
  password: "my-secret-password",
  nickname: "coolnickname",
};

const simpleJwtLogin = new SimpleJwtLogin(
  "http://your-domain.com",
  "/simple-jwt-login/v1"
);
let result = simpleJwtLogin.registerUser(params, "MY_AUTH_KEY");

or

import { SimpleJwtLogin } from "simple-jwt-login";

const simpleJwtLogin = new SimpleJwtLogin(
  "http://your-domain.com",
  "/simple-jwt-login/v1",
  "AUTH_KEY"
);
let params = {
  email: "me@mydomain.com",
  password: "my-secret-password",
  nickname: "coolnickname",
};
let result = simpleJwtLogin.registerUser(params, "MY_AUTH_KEY");

Class Methods

Constructor

/**
 * @param host WordPress instance domain
 * @param namespace Simple-JWT-Login route namespace. Optional. Default to /simple-jwt-login/v1
 * @param authCodeKey Simple-JWT-Login AUTH_CODE_KEY. Optional. Default to AUTH_KEY
 */
constructor(host: string, namespace: string = '', authCodeKey: string = '')

Autologin

/**
 * @param params Request parameters
 * @param authCode AuthCode value. Optional
 */
public autologin(params: AutologinInterface, authCode:string = '')

Delete User

/**
 * @param params Request parameters
 * @param authCode AuthCode value. Optional
 */
public deleteUser(params: DeleteUserInterface, authCode:string = '')

Register User

/**
 * @param params Request parameters
 * @param authCode AuthCode value. Optional
 */
public registerUser(params: RegisterUserInterface, authCode: string = '')

Reset Password

/**
 * @param params Request parameters
 * @param authCode AuthCode value. Optional
 */
public resetPassword(params: ResetPasswordInterface, authCode:string = '')

Change Password

/**
 * @param params Request parameters
 * @param authCode AuthCode value. Optional
 */
public changePassword(params: ChangePasswordInterface, authCode:string = '')

Authenticate

/**
 * @param params Request parameters
 * @param authCode AuthCode value. Optional
 */
public authenticate(params: AuthenticateInterface, authCode:string = '')

Refresh Token

/**
 * @param params Request parameters
 * @param authCode AuthCode value. Optional
 */
public refreshToken(params: RefreshTokenInterface, authCode:string = '')

Validate Token

/**
 * @param params Request parameters
 * @param authCode AuthCode value. Optional
 */
public validateToken(params: ValidateTokenInterface, authCode:string = '')

Revoke Token

/**
 * @param params Request parameters
 * @param authCode AuthCode value. Optional
 */
public revokeToken(params: RevokeTokenInterface, authCode:string = '')

Readme

Keywords

none

Package Sidebar

Install

npm i simple-jwt-login

Weekly Downloads

5

Version

0.1.5

License

GPL-3.0

Unpacked Size

80.2 kB

Total Files

62

Last publish

Collaborators

  • nicumicle