This repository contains SDK for user API instances signed with OAuth 2.0 Bearer token.
Available currently only for backend -> backend communication, usage would be as follows
import { configure, isErrorResponse } from '@berlingske-media/bm.node-module.user-api-sdk';
import { getAccessToken } from '@berlingske-media/bm.node-module.auth_plugin';
const authToken = getAccessToken();
const sdk = configure(
'https://usa-qa1--usersegment--idm.berlingskemedia-testing.net',
authToken,
'source_service_name',
);
const result = await sdk.getBySSOUID('db1d8395d96f473984ea2f7ab947dcf8');
if (isErrorResponse(result)) {
console.log(result.errorCode);
} else {
console.log(result.body);
}