Skip to main content
To start with, you need at least an html page loaded from your site where you will load the app unto. If you already have a website in place, this will naturally be your products page template.
The code you are about to create can be downloaded here: sample SDK index.html on GitHub
The PitchPrint app relies on a few libraries and we have made efforts to bundle them all into a single file. So for a start, let’s assume you are starting with an empty html page like this:
PitchPrint relies on jQuery Blueimp uploader for file upload. So at the header, first load your jQuery, then add the PitchPrint client file as follows..
Now load your page in a browser and check the browser console that there is no error whatsoever from PitchPrint and also check the resources > scripts tab and ensure the files are loaded. We suggest using Chrome developer tool for this. Next, we just created the html elements that we need to interact with… A loader indicator, the launch button and a div to place our final preview images once the customer has finished customizing their design. After that, we write out javaScript code to do the magic..

Let’s get a reference to our UI elements

First, we need to get our elements into variables so we can use them later on, as follows:

Initialize PitchPrint client

Next, we need to initialize the PitchPrint client class, which will return us a reference () to interact with the app..

Define our event handler functions

These are the two functions we are going to define to handle the app validated and project saved events..

Attach events to the app

So here, we are going to attach events to the PitchPrint client class, such that if any of the events happen, it calls out functions

Test our app

Ok, so far so good, you can test the page in a browser and see that it loads properly and that there are no errors thrown. To test, click the Launch Designer button. And your designer should show like this. If not, please open a ticket and let us know. The designer opened from the Launch Designer button Using your own credentials For simplicity, we have used our own demo-credentials, that is API key and designId. Now you should change these to yours, the one you created in the previous topic. So in the variables definition, change the apiKey value to your own apiKey. To get your designId, navigate to the designs page. Open the configuration tab of the design which you would like to use. Go to the history tab and you’ll see the designId please have a look below for reference:
History tab of a design's configuration, showing where the designId appears
Use the designId inside the code snippet as shown above. Save, reload page and ensure everything works fine. Next, we will explain what happens next when the customer saves their design.

Introduction

Overview of what PitchPrint is and how it works.

Generate your auth keys

Create the API and Secret keys needed to integrate the app.

After Save

Handle the project-saved event and use the returned data.

My Account - Saved Projects

Add a My Account page so customers can view their saved projects.