Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
52 lines (46 sloc) 2.1 KB
<title>PitchPrint Sample SDK</title>
<script src=""></script>
<script src=""></script>
<div id="pp_loader_div"><img src="" ></div>
<button id="launch_btn" >Launch Designer</button>
<div id="pp_preview_div"></div>
(function() {
//Get handles to the UI elements we'll be using
var _launchButton = document.getElementById('launch_btn'),
_previewDiv = document.getElementById('pp_preview_div'),
_loaderDiv = document.getElementById('pp_loader_div');
//Disable the Launch button until PitchPrint is ready for use
_launchButton.setAttribute('disabled', 'disabled');
/*Initialize PitchPrint.
Kindly read more here on the options..
var ppclient = new PitchPrintClient({
apiKey: 'f80b84b4eb5cc81a140cb90f52e824f6', //Kinldy provide your own APIKey
designId: '3d8f3899904ef2392795c681091600d0', //Change this to your designId
custom: true
//Function to run once the app is validated (ready to be used)
var appValidated = () => {
_launchButton.removeAttribute('disabled'); //Enable the Launch button
_launchButton.onclick = () => ppclient.showApp(); //Attach event listener to the button when clicked to show the app = 'none'; //Hide the loader
//Function to run once the user has saved their project
var projectSaved = (_val) => {
let _data =; //You can console.log the _data varaible to see all that's passed down
if (_data && _data.previews && _data.previews.length) {
_previewDiv.innerHTML = _data.previews.reduce((_str, _prev) => `${_str}<img src="${_prev}">`, ''); //Show the preview images
//Attach events to the app. You can see a list of all the events here:
ppclient.on('app-validated', appValidated);
ppclient.on('project-saved', projectSaved);