Skip to main content
This page provides practical code examples for common integration scenarios. Run them on your server: a key in a browser page can be read by every visitor.

Quick Start

Initialize the SDK

Using Async Token Provider

For short-lived tokens that rotate (see Authentication for token exchange):

Fetching Data

List Every Widget with Pagination

GET /widgets takes page and size, and is always newest first. meta.hasNextPage says whether to ask for another page:

Batch Fetch Multiple Widgets

Managing Canvases

Create and Update a Canvas

Partner Integration

Create Managed Users

A managed user is a record of one of your customers. It is not a login, and it does not own anything. See Managed Users.
To keep each customer’s work apart, send managedUserId (or your own id as managedUserExternalId) when you create a composition, a widget or an upload, and send the same field when you list. See Filing Content Under a Managed User.

Mount an Editor in Your Page

Preview. The editors are new, and small details can still change while this label is on. See UI Components.
Your server makes an editor session for the customer who is on the page, and the page mounts the editor with the token. The API key stays on your server.

Error Handling

Robust API Client

The SDK throws a ResponseError. The HTTP status is error.response.status, and error.code holds the machine-readable code from the API’s answer:

Embedding Widgets

A widget is shown on a page through a composition, and the page needs only the composition id. There is no key in the page.

Basic Embed

Embed as a Pop-up

embed-target decides where the widget appears: site inside the page, overlay as a pop-up, and mixed both. The overlay is the default. These attributes come from the composition’s embedSettings, so build them from the saved settings (see Compositions):

Next Steps

SDKs

Explore our SDK options

API Reference

Complete endpoint documentation