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

2.2.55 • Public • Published

Adding to project

npm install @tipser/tipser-sdk

Usage

Importing

ES6 imports syntax:

import { TipserSDK } from '@tipser/tipser-sdk'; or import { TipserSDK } from '@tipser/tipser-sdk/bare';

CommonJS syntax:

const { TipserSDK } = require('@tipser/tipser-sdk'); or const { TipserSDK } = require('@tipser/tipser-sdk/bare);

Polyfills

Check our MIT file to check what polyfills are required sdk to work. If you prefer to handle polyfills in your project by yourself, and your target is IE11 please make sure that you include polyfills listed above, and import @tipser/tipser-sdk/bare bundle. Otherwise, you are most welcome to import @tipser/tipser-sdk bundle which already includes polyfills necessary to be run in IE11.

Basic usage

import {TipserSDK} from '@tipser/tipser-sdk';

//...
const tipserSdk = TipserSDK(posId, {
    modalUi: {
        hideSimilarProducts: true
    }
});

tipserSdk.openProductDialog('5ba2334a781baa0001ccdf33');
//...

Usage in Typescript project

tipser-sdk package includes Typescript type definitions, so when used in Typescript project, type checking will work out of the box as well as autocompletion features of IDEs. In case the configuration is stored in a variable, the TipserSdkConfig type may be used as a type of that variable.

import { TipserSDK, TipserSdkConfig } from '@tipser/tipser-sdk';

//...
const tipserSdkConfig: TipserSdkConfig = {
    modalUi: {
        hideSimilarProducts: true
    }
}

const tipserSdk = TipserSDK(posId, tipserSdkConfig);

tipserSdk.openProductDialog('5ba2334a781baa0001ccdf33');
//...

Runtime Logs in Dev Tools

Logger register himself on a top window global object. It communicates with all other logger instances inside of iframes.

To turn on logger, and it's all instances in other iframes, go to Dev Tools console, ensure that top window context is selected and run following command:

TipserLogger.on()

To turn off:

TipserLogger.off()

Documentation

https://developers.tipser.com/tipser-sdk-script

Architecture

https://docs.google.com/drawings/d/1S9LoosqgZtsQUlTncvxY75zQUckUFx3t0X0uH7F9hoo

Publishing new versions

  1. Run npm run create-release-pr -- $(cat ~/.git-private-token) (.git-private-token containes GH personal token. How to create it?)
  2. Merge the PR on GH
  3. Switch to production locally and run yarn release
  4. Merge production back to develop (to sync version number in package.json)

In a less common scenario when you need to update minor or major version instead of patch version, replace yarn release command with one of the following commands:

  • npm version minor && git push --follow-tags
  • npm version major && git push --follow-tags

Readme

Keywords

none

Package Sidebar

Install

npm i @tipser/tipser-sdk

Weekly Downloads

1

Version

2.2.55

License

ISC

Unpacked Size

979 kB

Total Files

94

Last publish

Collaborators

  • tipser