KitsasService is a static class for connecting to Kitsas
Start by calling KitsasService.connect(options)
const connection = await KitsasService.connect({ username: 'user', password: 'password',}); Copy
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,}); Copy
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, }); }} Copy
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, }); }}
Static
Connect to Kitsas
Login and connection options
Connection object
KitsasConnectionOptions to see all options
InvalidCredentialsError if credentials are invalid
TFARequiredError if 2FA is required
Error if network or server errors occurs
KitsasService is a static class for connecting to Kitsas
Start by calling KitsasService.connect(options)
Example
See
To get a mock connection:
Example
Remarks
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
Example