@sonic-esports/auth-node
v0.0.3
Published
[Nodejs] Authentication module for sonic esports | Unstable
Downloads
3
Readme
Sonic Esports NodeJs Auth Module
by Debanjan Tewary
This module handle the authentication services for sonic esports servers.
Usage
/**
* Importing the auth client
*/
const { SeAuthNodeClient } = require("@sonic-esports/auth-node");
//OR
import { SeAuthNodeClient } from "@sonic-esports/auth-node";
Initialize the client instance with proper server config:
/**
* Sonic Server Config can be defined between two types
* DirectToDomainServerProps OR ManualServerConfigProps
*/
// DirectToDomainServerProps AKA Production Url
const auth = new SeAuthNodeClient({
domain: "http://localhost:8000/v1",
});
// ManualServerConfigProps
const auth = new SeAuthNodeClient({
protocol: "http",
port: 8000,
apiVersion: "v1",
host: "localhost",
});
Calling the methods:
await auth.loginUser({ username: "random", password: "123456789" });
Search other helpfull methods from docs