Recent searches

in

Introduction

Learn the foundational Visual Editor API skills for custom integrations by walking through the Doodle Gallery example.

Welcome to CloudCannon's guide on building custom integrations with the Visual Editor!

This guide teaches you the basics of CloudCannon's Visual Editor API, enabling you to build custom integrations with JavaScript. These integrations run inside the Visual Editor to read and write content, upload files, and build editing experiences tailored to your Site. We recommend this guide for experienced CloudCannon developers and power users looking to extend the Visual Editor's functionality.

The Visual Editor API provides a set of methods — what you do with these is up to you. In this guide, we'll use the CloudCannon repository "Doodle Gallery" as an example, but you are not limited to creating similar integrations. CloudCannon's Editable Regions and Rosey CloudCannon Connector are examples of custom integration built with the Visual Editor API. Additionally, the Doodle Gallery is built with Astro and React, but the Visual Editor API skills transfer to any framework or static site generator.

A screenshot of the Visual Editor shows the Doodle Gallery's drawing tool at the top of a webpage preview, with a blank canvas, a caption field, and an Add to the gallery button.

The Doodle Gallery adds a drawing tool to the Visual Editor, where Team Members can sketch a doodle, give it a caption, and submit it to the Site. This tool is only visible inside the Visual Editor, appearing in the webpage preview but never on the live version of your website. When you submit a sketch, the Visual Editor API uploads the drawing as an image and adds it to a gallery data file that renders on the live webpage. You can find the complete example in the doodle-example repository.

In this guide, we'll cover how the Visual Editor API works, how to detect the Visual Editor and initialize the API, render a custom interface, upload a file, and write new data back to the Site without overwriting other people's changes.

Before we begin, this guide assumes you already have a Site whose pages render in CloudCannon's Visual Editor, and that you're comfortable writing JavaScript. If your Site isn't set up for visual editing yet, please read our documentation on setting up visual editing first. For a complete list of API objects and methods, please read our reference documentation on the Visual Editor API.

Build custom Visual Editor integrations (1/7)
Introduction
Open in a new tab