Skip to content

Latest commit

 

History

History
92 lines (64 loc) · 2.64 KB

File metadata and controls

92 lines (64 loc) · 2.64 KB

Picturepark Content Platform TypeScript SDK: Pickers

picturepark-sdk-v1-pickers

NPM Package: @picturepark/sdk-v1-pickers

The picturepark-pickers.js library provides methods to open the Picturepark content picker dialog to select a content item in a third party application.

Downloads

NPM Package:

Latest version from master branch (use for development only):

Samples

To run the samples navigate to the root of the repository and run:

npm run start:pickers

Browser support

Usage

Load the required JavaScript library:

Global module

<script src="picturepark-pickers.js"></script>

Open the picker and handle the response:

pictureparkPickers.showContentPicker("https://your-picturepark-server.com").then(function (result) {
  if (result) {
    // TODO: The user selected some content items and an embedded share has been created
  } else {
    // TODO: The user clicked cancel
  }
});

The result is undefined if the user clicked cancel or looks like:

{
  "token": "nGmmbMyX",
  "shareId": "114bddcf617f4becbc4da981b457ba22",
  "items": [
    {
      "token": "JQTe0hgT",
      "url": "https://devnext.preview-picturepark.com/Embed/JQTe0hgT"
    },
    {
      "token": "7EEpblZt",
      "url": "https://devnext.preview-picturepark.com/Embed/7EEpblZt"
    },
    {
      "token": "bnNGJUUp",
      "url": "https://devnext.preview-picturepark.com/Embed/bnNGJUUp"
    }
  ]
}

AMD module

Install the NPM package:

npm install @picturepark/sdk-v1-pickers

Next, import the `` function and call it:

import { showContentPicker } from '@picturepark/sdk-v1-pickers';

showContentPicker('https://devnext.preview-picturepark.com').then(...);