LogoLogo
  • iPaper Technical Documentation
  • Display Analytics
    • Google Analytics
  • Display JavaScript API
    • Quick Start
    • Commands
    • Events
  • Flipbook Analytics
    • Adobe Analytics events
    • Google Analytics / GTM events
  • Flipbook Backend API
    • Overview
    • Return Codes
    • Ecommerce
      • GetFlipbookOrdersByType
      • GetLicenseOrdersByType
    • Image
      • GetImageWith2PxDropShadow
    • Link
      • GetLinks
    • Media
      • CreateDirectory
      • DeleteDirectory
      • DeleteFile
      • GetTree
      • UploadFile
    • Paper
      • ChangePaperUrl
      • ClearPublicationPeriod
      • CreateCategory
      • CreatePaper
      • CreatePreviewToken
      • DeletePaper
      • GetAllPapers
      • GetPaperIDFromUrl
      • GetPaperStructure
      • GetPaperUrlFromID
      • GetSetting
      • GetSettingDescriptions
      • MovePaper
      • SetPublicationPeriod
      • SetSetting
    • Ripper
      • GetProcessingPapers
      • GetProcessingStatus
      • ProcessPDF
      • ReprocessPaper
    • Search
      • SearchPapersByContent
      • SearchPapersByCustomFields
      • SearchPapersWithHiearchyByContent
      • SearchPapersWithHiearchyByName
    • Statistics
      • GetNumberOfPageviewsPerDay
      • GetNumberOfVisitors
      • GetNumberOfVisitorsPerDay
  • Flipbook Enrichment
    • Popup Content
    • Popup Frame
  • Flipbook Integration
    • Custom Domain
    • Custom Mail
    • Embedding flipbooks inside iOS and Android App
    • Form Integration
    • Iframing Flipbooks
    • iPaper Embed Script (Pop-ups)
    • Embeds (Minipapers)
    • Query String Parameters
    • Remote Authentication
    • Shop Export
  • Flipbook JavaScript API
    • Getting Started
    • Commands & Events
      • Basket
      • Consent
        • Example Implementations
          • UserCentrics
          • OneTrust
          • CookieInformation
          • Cookiebot
      • Paging
      • Publication
      • Search
      • Table of Contents
      • Sharing
    • Advanced Usage
    • Migration guide
    • Legacy Javascript API (v2)
      • Quick Start
      • Commands
      • Events
      • Consent Management
      • Advanced Usage
  • Technical Information
    • Cookie Information
    • Common security questions
    • Open Source
Powered by GitBook
On this page
  • Setting up the API for embedded Flipbooks
  • Setting up the API in Custom Scripting
  1. Flipbook JavaScript API

Getting Started

The Flipbook JavaScript API allows you to interact with flipbooks, executing commands and subscribing to events.

PreviousShop ExportNextCommands & Events

Last updated 1 month ago

The Flipbook JavaScript API makes it easy to execute commands in flipbooks as well as listen/subscribe to events happening inside these. The JS API is available both for embedded flipbooks as well as directly in the flipbook viewer through custom scripting.

Below are some guides to get you set up and ready to start exploring the possibilities of the JS API.

Setting up the API for embedded Flipbooks

In order to use the JS API you must include the API script on your page. The API script can be seen below:

<script src='https://cdn.ipaper.io/flipbooks/api/v3/latest.js'></script>

Once you have included this script on your page, you will need to instantiate a new instance of the API. When doing so you specify an iframe to target (your embedded flipbook) as well as an API version to use (version 3 is the latest and only version currently available):

<script>
    const iframe = document.getElementById('myFlipbook');
    const instance = iPaperJsApi(iframe, 3);
</script>

Once this has been done, you're ready to start using the JS API. You can explore the . You will be able to call/use these on the instance you set up above (i.e. instance.[Category Name].[Command/Event name]).

When using the JS API with embedded flipbooks, it is possible to have multiple flipbooks where each of them has their own API instance set up.

Setting up the API in Custom Scripting

Using the JS API through the Flipbook Custom Scripting module is simple. The API script is already included in the flipbook viewer, so all you need to do is add a script that instantiates a new instance of the API. When doing so you will need to specify a version to use (version 3 is the latest and only version currently available):

<script>
    const instance = iPaperJsApi(3);
</script>

Once this has been done, you're ready to start using the JS API. You can explore the . You will be able to call/use these on the instance you set up above (i.e. instance.[Category Name].[Command/Event name]).

available commands and events here
available commands and events here
Please refer to this page on an example of this usage.