npm i @or-sdk/library
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',
});
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',
});