GitHub

@cfwest/login

Install using

npm install @cfwest/login

Exported Members

You can access these members by importing the module:

import { member } from '@cfwest/login';

LoginConfig

interface LoginConfig

Interface used to configure [LoginModule].

Properties

captchaToken

Type: string

2Captcha API Key used for reCAPTCHA authentication.

headless

Type: boolean

Specify if the browser session should be started headless.

LoginCookie

interface LoginCookie

Interface which represents a Login Cookie returned from Z8Games

Properties

name

Type: string

Cookie name

value

Type: string

Cookie value

domain

Type: string

Cookie domain

path

Type: string

Cookie path

expires

Type: number

No docs provided

LoginCredentials

interface LoginCredentials

Interface used for z8Games account login credentials.

Properties

id

Type: string

Z8Games Account Login ID

password

Type: string

Z8Games Account Password

LoginModule

class LoginModule

The LoginModule is used to get [LoginCookie]s which can be used for authenticated requests.

Constructors

constructor

function (
   config : LoginConfig
) : any

Create a new [LoginModule] instance. Use the config options to configure the module.

@param:

config The [LoginConfig] options to use.

Properties

Methods

async authenticate (...)

async function authenticate (
   credentials : LoginCredentials
) : Promise<LoginCookie[] | undefined>

Authenticate with an Z8Games Account. Use the returned [LoginCookie] for authenticated requests.

@param:

credentials - Account credentials

@returns:

[LoginCookie] Array of login cookies. Returns undefined in case of error/timeout