ProsperWorks App SDK

Travis branch npm Test Coverage Maintainability

The javascript SDK provides client-side functionalities for adding embedded app to the prosperworks web client.

Embedded app is an iframe embedded in the prosperworks web page. The display location of the iframe is configured in the embedded app setting page.

Usage

Use with your webpack/rollup/browserify etc.

yarn add pw-app-sdk
# or
npm install pw-app-sdk --save

Then you could just do

import PWSDK from 'pw-app-sdk';
const sdk = PWSDK.init();

sdk.getContext()
  .then(({ context }) => {
    // do something with the context
  });

Use with CDN

pw-app-sdk is served with https://www.jsdelivr.com/package/npm/pw-app-sdk

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/pw-app-sdk@0.2.5/dist/pwsdk.min.js"></script>
<script type="text/javascript">
var sdk = window.PWSDK.init();
sdk.getContext()
  .then(function (data) {
    var type = data.type; // person,lead,...
    var context = data.context;
    // do something with the context
  });
</script>

SDK Docs

https://prosperworks.github.io/pw-app-sdk

Development

Prerequisites

Before development, make sure you installed all packages. We are using yarn for this project.

yarn

Developing SDK

## watch changes
yarn dev:es
# or
yarn dev:commonjs

## build
yarn build

## test
yarn test
# or watch changes
yarn test:dev

## lint
yarn lint

FAQ

How do I use my local SDK instead of the npm one?

You could do yarn link in this repo, and go to your other repo and do yarn link pw-app-sdk.

Alternatively, you could also do npm link path/to/pw-app/sdk in your repo.

results matching ""

    No results matching ""