0.0.3 • Published 6 months ago

@sonic-esports/auth-node v0.0.3

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

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

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago