Search…
VMST

VMST Client

About

This library implements a client to use VMST APIs

Import into other NestJS modules

Add the service to your module imports:
1
import { VMSTModule } from '@island.is/clients/vmst'
2
3
@Module({
4
imports: [
5
VMSTModule.register({
6
xRoadBasePath: XROAD_BASE_PATH,
7
xRoadClient: XROAD_CLIENT,
8
apiKey: VMST_API_KEY,
9
}),
10
],
11
})
Copied!
Then you'll have access to VMST APIs:
1
import { UnionApi } from '@island.is/clients/vmst'
2
3
@Injectable()
4
export class SomeService {
5
constructor(private unionApi: UnionApi) {}
6
7
async getUnions(): Promise<Union[]> {
8
const { unions } = await this.unionApi.unionGetUnions()
9
10
if (unions) {
11
return unions
12
}
13
14
// ....
15
}
16
}
Copied!

Code owners and maintainers