Iframe SDK
When a user SSOs into your App via the iframe, Duda passes in a URL like sdk_url=https%3A%2F%2Fsandbox-ms-cdn.multiscreensite.com%2Fintegrationhub%2F3264%2Fres%2Fsdk%2Fiframe.js
. This is a javascript file that you can embed into your App, using a simple script tag:
<script src="https://sandbox-ms-cdn.multiscreensite.com/integrationhub/3264/res/sdk/iframe.js"></script>
Once embedded, this gives the front end of your App access to the following functions:
Upgrade
_dAPI.upgrade(upgradeConfig)
communicates with the Duda editor to open a upgrade pop-up, in order to take payment for a higher plan. There are two options when upgrading: Display a single, specific plan or display a list of plans:
Single Plan
When calling the upgrade function, you can pass in the following config object to have Duda display a single plan:
const upgradeConfig = {
type: 'upgradeApp',
appId: 'fc0cf63e-d579-4b17-b579-aa3cf50e09f1',
planId: '4725fcf8-1256-4d5c-803c-69385b565ced'
};
Multiple Plans
Instead of showing a single specific plan, you can also pass in a list of plans:
const upgradeConfig = {
type: 'upgradeApp',
appId: 'fc0cf63e-d579-4b17-b579-aa3cf50e09f1',
plansList: ['4725fcf8-1256-4d5c-803c-69385b565ced','58b18228-6f9e-4942-bfb5-1d3a06981ce9']
};
Refresh Editor
_dAPI.refresh()
If your App installs a floating widget or anything visible on the website, you can ask the Duda editor to refresh the site (behind your App iframe) in order to display that widget.
Updated 12 months ago