Skip to main content

Introduction

Use the Partoo JavaScript SDK to embed Partoo views into your website via an iframe. The SDK provides utilities to configure, initialize, and control the embedded experience.
The SDK dynamically inserts an iframe and returns a helper instance that you can use to authenticate users and navigate pages.

Environments

Partoo offers two environments:
  • Sandbox: For development and testing
    URL: https://static.sandbox.partoo.co/jssdk/partoo.js
  • Production: For live deployment
    URL: https://static.partoo.co/jssdk/partoo.js

Integration Steps

1

Import the SDK

Include the SDK in your HTML <head>:
<script src="https://static.partoo.co/jssdk/partoo.js" type="text/javascript"></script>
This exposes a global Partoo object for use in your scripts.
2

Generate a Connection Token

Before rendering any views, generate a connection token for your authenticated user.
Refer to the authentication API documentation for details on generating this token.
3

Insert a Target Container

Add a target <div> where the Partoo iframe will load:
<div id="your-container-id"></div>
Do not use partoo-iframe as the container ID—it’s reserved internally.
4

Initialize and Login

Use the SDK to create and display the iframe:
const connectionToken = 'YOUR_CONNECTION_TOKEN';

const options = {
  startPage: 'presenceManagement',
  displayIntercom: false,  // Optional: default is true
  displayAddButton: false  // Optional: default is true
};

const partooPage = Partoo.init('your-container-id', options);
partooPage.login(connectionToken);
This logs in the user and displays the startPage.
5

Display a Specific Business

To load a business edit view directly, pass both startPage and selectedBusinessId:
const options = {
  startPage: 'business',
  selectedBusinessId: '62ba00000000000000000000',
  displayIntercom: false,
  displayAddButton: false
};

const partooPage = Partoo.init('your-container-id', options);
partooPage.login(connectionToken);

Page Navigation

Use the partooPage instance to programmatically navigate:
partooPage.navigate('businesses'); // Go to the businesses list
partooPage.back();                 // Go back to the previous page
partooPage.forward();              // Go forward to the next page
partooPage.destroy();             // Remove the iframe

Next Steps

Thanks to this quick tutorial, you learned how to display your first Partoo app view thanks to the JS SDK. To build a production ready integration, you might want to check the Integration Guide.