@sonic-esports/auth-node
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Sonic Esports NodeJs Auth Module

by Debanjan Tewary

This module handle the authentication services for sonic esports servers.

Static Badge

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

Readme

Keywords

none

Package Sidebar

Install

npm i @sonic-esports/auth-node

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

68.6 kB

Total Files

9

Last publish

Collaborators

  • sonicesports