Passports
yarn nx run clients-passports:schemas/external-openapi-generator
- Import the
PassportsClientModule
within the service of choice.
import { PassportsClientModule } from '@island.is/clients/passports'
@Module({
...,
imports: [PassportsClientModule],
...,
})
- Pass in the IdentityDocumentApi
import { IdentityDocumentApi } from '@island.is/clients/passports'
constructor(
private passportsApi: IdentityDocumentApi,
)
- Use with auth middleware
private getPassportsWithAuth(auth: Auth) {
return this.passportsApi.withMiddleware(new AuthMiddleware(auth))
}
- Now you can access the service with authentication
const passportResponse = await this.getPassportsWithAuth(
auth,
)
.identityDocumentGetIdentityDocument({
personId: '1234567890',
})
console.log('passportResponse', passportResponse)
Last modified 1mo ago