Search…
User Profile

User Profile Client

This library implements a client to use User Profile APIs

app.module.ts

1
import { ConfigModule } from '@island.is/nest/config'
2
import { UserProfileClientModule, UserProfileClientConfig } from '@island.is/clients/user-profile'
3
4
@Module({
5
imports: [
6
UserProfileClientModule,
7
ConfigModule.forRoot({
8
isGlobal:true,
9
load:[UserProfileClientConfig]
10
})
11
],
12
})
Copied!

some-name.module.ts

1
import { UserProfileClientModule } from '@island.is/clients/user-profile'
2
3
imports: [
4
UserProfileClientModule
5
],
Copied!

some-name.service.ts

1
import { UserProfileApi } from '@island.is/clients/user-profile'
2
3
4
@Injectable()
5
export class SomeService {
6
constructor(
7
@Inject(UserProfileApi)
8
private readonly userProfileApi: UserProfileApi,
9
) {}
10
11
async getStuff(@CurrentUser() user: User)
12
return this.UserProfileApi.userTokenControllerGetDeviceTokens({nationalId:user.nationalId})
Copied!

machine client auth

Check out AutoAuth.