@or-sdk/library
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

Library Api SDK

Installation

npm i @or-sdk/library

Usage

import { LibraryV2, LibraryV1 } from '@or-sdk/library'
import config from '../config';

const libraryV1Sdk = new LibraryV1({
  token: () => 'USER <token>',
  libraryApiUrl: config.LIBRARY_API_URL,
  feature: config.FEATURE,
  packageType: 'STEP',
});

const libraryV2Sdk = new LibraryV2({
  token: () => 'USER <token>',
  libraryApiUrl: config.LIBRARY_API_URL,
  feature: config.FEATURE,
  packageType: 'STEP',
});

// discoveryUrl slower than libraryApiUrl
const librarySdk = new LibraryV2({
  token: () => 'USER <token>',
  discoveryUrl: 'http://example.library/endpoint',
  feature: config.FEATURE,
  packageType: 'STEP',
});

Javascript Usage

This js docs for js project will add to IDE correct autocomplete.

import { LibraryV2, LibraryV1 } from '@or-sdk/library'

/**
 * Returns new LibraryV1 instance
 * @type {LibraryV1}
 * @returns {Object} - LibraryV2 instance
 */
export default new LibraryV1({
  token: () => 'USER <token>',
  libraryApiUrl: config.LIBRARY_API_URL,
  feature: config.FEATURE,
  packageType: 'STEP',
});

/**
 * Returns new LibraryV2 instance
 * @type {LibraryV2}
 * @returns {Object} - LibraryV2 instance
 */
export default new LibraryV2({
  token: () => 'USER <token>',
  libraryApiUrl: config.LIBRARY_API_URL,
  feature: config.FEATURE,
  packageType: 'STEP',
});

Readme

Keywords

none

Package Sidebar

Install

npm i @or-sdk/library

Weekly Downloads

241

Version

0.3.2

License

Apache-2.0

Unpacked Size

167 kB

Total Files

42

Last publish

Collaborators

  • onereach.user
  • onereach.admin