Home Reference Source

Function

Static Public Summary
public

Get the schools matching query.

public

Create a new Magister object using options.

Static Public

public getSchools(query: string): Promise<School[]> source

import {getSchools} from 'magister.js/src/magister.js'

Get the schools matching query.

Params:

NameTypeAttributeDescription
query string

Return:

Promise<School[]>

public magister(options: Object): Promise<Magister> source

import magister from 'magister.js/src/magister.js'

Create a new Magister object using options.

Params:

NameTypeAttributeDescription
options Object
options.school School

The school to login to.

options.username string
  • optional

The username of the user to login to.

options.password string
  • optional

The password of the user to login to.

options.token string
  • optional

The Bearer token to use. (instead of the username and password)

options.keepLoggedIn boolean
  • optional
  • default: true

Whether or not to keep the user logged in.

options.login boolean
  • optional
  • default: true

Whether or not to call login before returning the object.

options.authCode string
  • optional
  • default: AuthCode

The AuthCode that Magister uses in their requests. Per default we use the value from the @magisterjs/authcode package. Which you should keep up-to-date.

Return:

Promise<Magister>