Getting started
First, you need at least one HTML page loaded from your site where you will load the app. If you already have a website, this will naturally serve as your My Account page template. The HTML page will look something like this, one button takes you to the App, while the other goes to the My Account section.Initializing PitchPrint
We will begin by initializing PitchPrint. This has already been explained in the app integration section. We have added the userId, which will be useful for saving projects under the correct accounts.Setting up client and form input
This JavaScript function,doClient, initializes a PitchPrint client and sets up event handling for session saving.
Modal functionality
This is an optional step, following our layout.Fetching Projects from the API
This JavaScript code fetches recent projects from an API and displays them on a webpage. Here’s a summary of its functionality:- A
POSTrequest is made tohttps://api.pitchprint.io/client/fetch-recentwith a JSON body containing a token for authentication. - The response is parsed as JSON.
- For each project, a
divelement is created and styled. - The project’s image, title, and user ID are displayed within the
div. - Two buttons are added: “View” and “Delete”.
Related articles
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.
Integration
Load the PitchPrint app into your page and wire up events.
After Save
Handle the project-saved event and use the returned data.