Class KitsasService

KitsasService is a static class for connecting to Kitsas

Start by calling KitsasService.connect(options)

const connection = await KitsasService.connect({
username: 'user',
password: 'password',
});

To get a mock connection:

const connection = await KitsasService.connect({
username: 'test@kitsas.fi',
password: 'Test+12345',
mock: true,
});

In case of two factor authentication, your first connection will throw TFARequiredError with a code (request2fa). Make a new connection with this code as username and the code from the authenticator app as password

try {
await KitsasService.connect({
username: 'use2fa@kitsas.fi',
password: 'Test+12345',
mock: true,
});
} catch (error) {
if (error instanceof TFARequiredError) {
const connection = await KitsasService.connect({
username: error.getRequestKey(),
password: '123456',
mock: true,
});
}
}

Constructors

Methods

Constructors

Methods