@berlingske-media/bm.node-module.user-api-sdk
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Berlingske-Media user api-type instance SDK

This repository contains SDK for user API instances signed with OAuth 2.0 Bearer token.

Usage

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);
}

Readme

Keywords

none

Package Sidebar

Install

npm i @berlingske-media/bm.node-module.user-api-sdk

Weekly Downloads

24

Version

2.0.0

License

Apache-2.0

Unpacked Size

30.1 kB

Total Files

15

Last publish

Collaborators

  • bmxape
  • berlingskemedia
  • bm-berlingske
  • bm-bt
  • bm-business
  • kbukowski
  • xpiku