API Reference
A list of all functions and attributes available on the framer Plugin API.
Branching APIs
Framer provides APIs to interact with project branches. A branch is an isolated copy of the project that can be edited and published without affecting the main branch. Use these APIs to read the active branch, look up or list existing branches, create a new branch, and subscribe to branch changes while the user works.
Get the active project branch in which edits currently occur.
Get a project branch by ID.
Get all project branches or a subset by their IDs.
Creates a branch and switches the editor to it.
Canvas APIs
Framer provides APIs to interact with our Canvas. These APIs range from directly editing Nodes, to Images, and Drag & Drop. Learn more about Nodes in our guide.
Get the current selection.
Set the current selection.
Get the root of the current canvas.
Create a new node on the canvas.
Remove nodes from the canvas.
Clone a node.
Get a node by its id.
Get the parent of a node.
Get the children of a node.
Get the rect of a node
CMS APIs
Framer provides APIs to interact with our CMS. Collections can be either user-created (Unmanaged) or controlled by a Plugin (Managed). The Collection types share similar API structures and Plugin authors can choose which Collection type works best for their use-case. Reference the latest APIs below or learn more with the CMS guide.
Retrieve the currently active managed Collection from the UI.
Retrieve Collections that are managed by the current Plugin.
Get a collection by its id.
Retrieve the Collection currently active (selected) in the Framer UI.
Get all Collections in the project, both managed and unmanaged.
Create a new collection.
Add a new plugin-managed CMS Collection.
Code File APIs
The CodeFile API allows plugins to create, read, update, and manage code files within a Framer project. A code file exports either overrides or code components.
Install a custom code snippet in the user's website via <script> tags.
Get custom code settings set by the plugin.
Create a new code file in the project.
Get all code files in the project.
Get a specific code file by its ID or file path.
Type check a code file and return the diagnostics.
Updates the version of the given dependency to the specified version.
Localization APIs
Framer provides APIs to interact with our Localization functionality. The key pieces of Localization in Framer are Locales, Localization Groups, and Localization Sources. Locales are a language paired with an optional region, like English or English (Canada). Localization groups are things like pages or CMS items that contain one or more Localization sources. Localization sources are the strings from your site, along with their localized values.
Get all Locales in the project.
Get the default locale of the project.
Get the currently active locale.
Get Localization Groups in the project, optionally filtered.
Update localization data.
Navigation APIs
Use the Navigation API to programmatically navigate the UI to a canvas node, a CMS collection item, or a code file. Plugins can optionally select targets, zoom to canvas layers, or focus a specific field in the item editor.
Pans and zooms the viewport to center a single or group of nodes.
Navigate the Framer UI to a target by its ID.
Permissions APIs
Plugins can do only what the user can. These APIs let you find out if the methods you need are available to the user, and potentially disable certain functions of your Plugin if not. Learn more with the Permission guide.
Find out if user's permissions allow them to execute all of methods:
Plugin UI APIs
A set of functions for opening and closing the Plugin itself, along with options setting a specific size for your Plugin. Plugins are able to run completely UI-less if desired.
Show the plugin window.
Hide the plugin window, without stopping the plugin.
Update the background status text shown while the plugin UI is hidden.
Close and terminate the plugin.
Get plugin data by key.
Set plugin data by key.
Get all plugin data keys.
Set the plugin's menu, which is shown in the plugin window header.
Show a context menu at the given location.
Publishing APIs
Framer provides APIs to publish a project and follow the resulting deployment. Publishing targets the active branch, staging, or production, depending on the project setup. Use these APIs to start a publish, inspect deployment status and optimization issues, list past deployments, and find the page changes that have not been published yet.
Publish the project in its current form.
Get the current deployment status snapshot.
Get the normalized optimization issues currently available for a deployment.
Gets page changes since the project was last published.
List deployments for the active branch.
Deploy a published version to custom domains.
Settings APIs
Framer provides APIs to interact with our Site Settings functionality. Redirects, currently the primary feature supported by these APIs, allow you to permanently route traffic from an old path to a new URL.
Get the project info like name and id.
Get information about the published website.
Get all Redirects in the project.
Add new redirects or update existing ones if their IDs match
Remove Redirects from the project.
Set the order of Redirects in the list.
When enabled, a modal confirmation will appear before close to confirm the action.
Get information about the user that's interacting with the plugin.