---
updatedAt: 2026-03-19T19:38:56.000Z
agentTools:
  projectIndex: https://developers.miro.com/llms.txt
---

# Custom Action Management

> 🚧 Important!
>
> Custom actions are only supported for **non-public** apps that will be **distributed privately via a shareable authorization link** from your App Settings page. This means that apps built with custom actions will **not** be eligible for distribution via the [Miro Marketplace](https://miro.com/marketplace) at this time, and cannot be widely and publicly distributed. Please follow our [Changelog](https://developers.miro.com/changelog) for further developments.

### Methods

### register(...)

<pre class="sdk-reference-type">(customAction: <a href="#customaction" title="CustomAction">CustomAction</a>&lt;T&gt;) =&gt; Promise&lt;<a href="#customaction" title="CustomAction">CustomAction</a>&lt;T&gt;&gt;</pre>

##### 🚦 Rate limit: [Level 1](https://developers.miro.com/docs/rate-limiting "1")

**<span><img alt="Experimental feature" src="https://files.readme.io/4598fa6-experimental-flask-color.svg" width="24" ></span> Experimental**

You use this method to register a custom action with an app.
The method takes a single argument: an object that defines the custom action.

You need to register custom actions in the [headless iframe](https://developers.miro.com/miro-ea/docs/app-panels-and-modals#headless) of your app so that the actions are available as long as the app is running on the board.
For Miro apps, this is usually the `index.js`/`.ts` file.
If you register a custom action in the [panel](https://developers.miro.com/miro-ea/docs/app-panels-and-modals#panel) or the [modal](https://developers.miro.com/miro-ea/docs/app-panels-and-modals#panel) iframe, the operation throws an error.

Custom actions registration requires two steps:

1. Subscribe to the event dispatched by the custom action using `miro.board.ui.on` method
2. Register custom action with it's definition. Apps cannot register custom actions that don't have subscription.

```typescript
await miro.board.ui.on('custom:translate-content', handler);
await miro.board.experimental.action.register(
  {
    "event": "translate-content",
    "ui": {
      "label":
        "en": "Translate content",
      "icon": "chat-two",
      "description": "Translate the content of the board items included in the current selection.",
    },
    "scope": "local",
    "predicate": {
      "type": "text"
    },
    "contexts": {
        "item": {}
    }
  }
);
```

You can learn more about custom action on our [tutorial](https://developers.miro.com/miro-ea/docs/add-custom-actions-to-your-app).

***

### deregister(...)

<pre class="sdk-reference-type">(eventName: string) =&gt; Promise&lt;void&gt;</pre>

##### 🚦 Rate limit: [Level 1](https://developers.miro.com/docs/rate-limiting "1")

**<span><img alt="Experimental feature" src="https://files.readme.io/4598fa6-experimental-flask-color.svg" width="24" ></span> Experimental**

Use this method to deregister a custom action that was previously registered by an app.

The method takes one argument:

* The name of the event used when registering the custom action.

```typescript
await miro.board.ui.on('custom:translate-content', handler);
await miro.board.experimental.action.register(
  {
    "event": "translate-content",
    "ui": {
      "label":
        "en": "Translate content",
      "icon": "chat-two",
      "description": "Translate the content of the board items included in the current selection.",
    },
    "scope": "local",
    "predicate": {
      "type": "text"
    },
    "contexts": {
        "item": {}
    }
  }
);

await miro.board.experimental.action.deregister("translate-content")
```

***

### Type definitions

##### CustomActionFilter

<pre class="sdk-reference-type">{
  $and?: Array&lt;<a href="#customactionfilter" title="CustomActionFilter">CustomActionFilter</a>&lt;T&gt;&gt;
  $eq?: T
  $exists?: boolean
  $gt?: T
  $gte?: T
  $in?: Array&lt;T&gt;
  $lt?: T
  $lte?: T
  $ne?: T
  $nin?: Array&lt;T&gt;
  $not?: <a href="#customactionfilter" title="CustomActionFilter">CustomActionFilter</a>&lt;T&gt;
  $or?: Array&lt;<a href="#customactionfilter" title="CustomActionFilter">CustomActionFilter</a>&lt;T&gt;&gt;
  $regex?: string
  $where?: string
}</pre>

##### CustomActionPredicate

<pre class="sdk-reference-type"><a href="#customactionpredicate" title="CustomActionPredicate">CustomActionPredicate</a>:
  | { $and?: Array&lt;<a href="#customactionpredicate" title="CustomActionPredicate">CustomActionPredicate</a>&lt;T&gt;&gt;; $not?: <a href="#customactionpredicate" title="CustomActionPredicate">CustomActionPredicate</a>&lt;T&gt;; $or?: Array&lt;<a href="#customactionpredicate" title="CustomActionPredicate">CustomActionPredicate</a>&lt;T&gt;&gt; }
  | <a href="#customactionfilter" title="CustomActionFilter">CustomActionFilter</a>&lt;T&gt;
  | {}
  | {}</pre>

##### CustomAction

<pre class="sdk-reference-type">{
  contexts?: { item?: {} }
  event: string
  predicate?: <a href="#customactionpredicate" title="CustomActionPredicate">CustomActionPredicate</a>&lt;ItemsProps&lt;T&gt;&gt;
  scope?: 'local' | 'global'
  selection?: 'single' | 'multi'
  <a href="#ui" <a href="#title" title="title">title</a>="ui">ui</a>?: {
    <a href="#description" title="description">description</a>?: string | Partial&lt;Record&lt;SupportedLanguages, string&gt;&gt;
    icon: string
    label: string | Partial&lt;Record&lt;SupportedLanguages, string&gt;&gt;
    position?: number
  }
}</pre>

##### contexts

`contexts` specifies where within the board UI the custom action will be accessible to users. It establishes the entry point for the custom action, indicating the UI element users can interact with to execute the custom action.

Currently, custom actions are available only in the context menu of selected board items.

Therefore, `item` is the only supported property for `contexts` at the moment.
The value of `contexts.item` is an empty object for now. Default value: `{}`.

```typescript
"contexts": {
  "item": {}
}
```

Makes the custom action available in a specific context on the board.
Currently, you can only make custom actions available in the context menu of selected board items, [Tag](https://developers.miro.com/miro-ea/docs/websdk-reference-tag) cannot be used as an item.

##### event

The name of the custom event to which the app subscribes in order to respond with a custom action. The `event` name must match the value of the `${string}` placeholder in the `custom:${string}` event name you provide to the `on` property when subscribing to the app.

* The event name can contain only lowercase alphabetic characters and hyphens (`^[a-z]+(-[a-z]+)\*$`).
* It cannot contain spaces.
* It cannot exceed 30 characters.

Example:

```typescript
// Event name
const eventName = 'translate-content';

// Custom event name that the app subscribes to.
await miro.board.ui.on(`custom:${eventName}`, handler);
```

##### predicate

The `predicate` property specifies the criteria that determine which board items a custom action applies to.

The custom action only appears in the context menu when all currently selected items match the conditions defined in `predicate`.

`predicate` evaluates each selected item individually, even with multi-selections. It checks each item separately and must return true for every item in the selection.

If any selected item fails the `predicate` check, the custom action does not display.

In summary, `predicate` allows you to selectively show custom actions based on rules that apply to the current selection. The action only appears when all selected items pass the `predicate` criteria.

* The conditions that you can set with `predicate` correspond to the supported board item properties.
* `predicate` syntax leverages the [MongoDB query DSL syntax](https://mongodb.github.io/casbah/3.1/reference/query_dsl/#query-selectors).
  This approach offers a wide range of operators that allow granular control of the availability of a custom action on the board UI.

```typescript
// Example of a predicate that makes a custom action available only when
// the selected board items are shapes, texts, or sticky notes.
"predicate": {
  "type": {
    "$in": ["shape", "text", "sticky_note"]
  },
}
```

##### scope

`scope` defines the scope of the custom action and how it interacts with other capabilities in the board. As of now, this property is not actually relevant since we only support `local` scope for the time being. Default value: `local`.

##### selection

`selection` determines whether the custom action is displayed for single or multiple selected items. Use `multi` if you want the custom action to be displayed when the selection includes 1 or more items and they all match the predicate. Use `single` for the custom action to be shown when there is only one selected item and it matches the predicate. Default value: `multi`.

**Note**: If the selection contains more than 100 items, the custom action will not be displayed.

##### ui

The object exposes content that is displayed to board users in the context menu when one or more board items are selected.

***

### All properties

<table><tr><th>Property</th><th>Type</th></tr>
<tr>
  <td><code>deregister(...)</code></td>
  <td>
    <pre class="sdk-reference-type">(eventName: string) =&gt; Promise&lt;void&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>register(...)</code></td>
  <td>
    <pre class="sdk-reference-type">(customAction: <a href="#customaction" title="CustomAction">CustomAction</a>&lt;T&gt;) =&gt; Promise&lt;<a href="#customaction" title="CustomAction">CustomAction</a>&lt;T&gt;&gt;</pre>
  </td>
</tr></table>

# Sibling pages

* [Interact with boards and items](https://developers.miro.com/miro-ea/docs/websdk-reference-interact-with-boards-and-items.md)
* [Rate limiting](https://developers.miro.com/miro-ea/docs/websdk-reference-rate-limiting.md)
* [Error handling](https://developers.miro.com/miro-ea/docs/websdk-reference-error-handling.md)
* [Board](https://developers.miro.com/miro-ea/docs/websdk-reference-board.md)
* [Card](https://developers.miro.com/miro-ea/docs/websdk-reference-card.md)
* [Board UI](https://developers.miro.com/miro-ea/docs/websdk-reference-ui.md)
* [Viewport](https://developers.miro.com/miro-ea/docs/websdk-reference-viewport.md)
* [Notifications](https://developers.miro.com/miro-ea/docs/websdk-reference-notifications.md)
* [App card](https://developers.miro.com/miro-ea/docs/websdk-reference-app-card.md)
* [Experimental](https://developers.miro.com/miro-ea/docs/websdk-reference-experimental.md)
* [Realtime Events](https://developers.miro.com/miro-ea/docs/websdk-reference-events.md)
* [Tag](https://developers.miro.com/miro-ea/docs/websdk-reference-tag.md)
* [Shape](https://developers.miro.com/miro-ea/docs/websdk-reference-shape.md)
* [Frame](https://developers.miro.com/miro-ea/docs/websdk-reference-frame.md)
* [Image](https://developers.miro.com/miro-ea/docs/websdk-reference-image.md)
* [Sticky Note](https://developers.miro.com/miro-ea/docs/websdk-reference-sticky-note.md)
* [Shape experimental](https://developers.miro.com/miro-ea/docs/websdk-reference-shape-experimental.md)
* [Embed](https://developers.miro.com/miro-ea/docs/websdk-reference-embed.md)
* [Connector](https://developers.miro.com/miro-ea/docs/websdk-reference-connector.md)
* [Unsupported](https://developers.miro.com/miro-ea/docs/websdk-reference-unsupported.md)
* [Mindmap Node](https://developers.miro.com/miro-ea/docs/websdk-reference-mindmap-node.md)
* [Preview](https://developers.miro.com/miro-ea/docs/websdk-reference-preview.md)
* [Text](https://developers.miro.com/miro-ea/docs/websdk-reference-text.md)
* [Storage collection](https://developers.miro.com/miro-ea/docs/websdk-reference-collection.md)
* [Storage](https://developers.miro.com/miro-ea/docs/websdk-reference-storage.md)
* [Collaboration](https://developers.miro.com/miro-ea/docs/websdk-reference-collaboration.md)
* [Session](https://developers.miro.com/miro-ea/docs/websdk-reference-session.md)
* [Attention](https://developers.miro.com/miro-ea/docs/websdk-reference-attention.md)
* [Group](https://developers.miro.com/miro-ea/docs/websdk-reference-group.md)
* [History](https://developers.miro.com/miro-ea/docs/websdk-reference-history.md)
* [Tools](https://developers.miro.com/miro-ea/docs/websdk-reference-tools.md)