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

# Frame

**Frame**

Frames are parent items that can group and hold together other items on a board, such as shapes, text, images, and so on.
When an item is a child of a parent frame, the child positioning reference is [relative to the parent frame](https://developers.miro.com/miro-ea/docs/boards#position-relative-to-parent).

Frames help structure and organize board content:

* They enable exporting board content to PDF, or to save it as a presentation.
* They are indexed; they make it easier to search for and find board content.
* When presentation mode is enabled on a board, indexed frames define the sequence of the slides in the presentation.

When creating or updating a frame item, you can define its dimensions in the following way:

* Set or update only `width`.
  Default width: `100` [dp](https://en.wikipedia.org/wiki/Device-independent_pixel)
* Set or update only`height`.
  Default height: `100` dp
* Set or update `width` and `height` at the same time.

ℹ️ Note:

* The minimum frame size is limited to 100x100 pixels.
* If you resize a parent frame containing child items, the Web SDK [throws an error](https://developers.miro.com/miro-ea/docs/web-sdk-error-handling#crud-operations) if one or more children fall outside the parent frame after resizing it.
  This isn't allowed, because it would break the parent/child relationship between the items.
  To break the relationship, explicitly [remove the child item(s)](#remove) from the parent frame.

Example:

```typescript
const frame = await miro.board.createFrame({
  title: 'This frame ratio is 16:9',
  style: {
    fillColor: '#ffffff',
  },
  x: 0, // Default value: horizontal center of the board
  y: 0, // Default value: vertical center of the board
  width: 800,
  height: 450,
});

// Output the created item to the developer console
console.log(frame);
```

Frame item:

<img alt="A frame parent item containing a sticky note as a child item." src="https://files.readme.io/f0bd6c4-frame-item.png" width="400"><br> **Figure 1.** A frame parent item containing a sticky note as a child item.

## Properties

### width

<pre class="sdk-reference-type">number</pre>

Width of the item in [dp](https://en.wikipedia.org/wiki/Device-independent_pixel).

See also:

* [Pixels and dimensions](./boards#pixels-and-dimensions)

***

### height

<pre class="sdk-reference-type">number</pre>

Height of the item in [dp](https://en.wikipedia.org/wiki/Device-independent_pixel).

See also:

* [Pixels and dimensions](./boards#pixels-and-dimensions)

***

### title

<pre class="sdk-reference-type">string</pre>

A short text header for the frame.
The text must be shorter than 6000 characters.

`title` supports only plain text.

***

### showContent

<pre class="sdk-reference-type">boolean</pre>

`showContent` enables to programmatically hide or reveal the content inside a frame.
The functionality works like the **show frame** and **hide frame** options available on the item context menu when the frame is selected on the board UI.

`showContent` is a boolean property:

* `showContent: true`: all the content inside the frame is visible.
* `showContent: false`: all the content inside the frame is hidden.
  On the board UI, an overlay is displayed over the frame to visually notify board users that they cannot view the frame content.

Default: `true`

ℹ️ Note:

* [Hiding and revealing the content inside frames](https://help.miro.com/hc/en-us/articles/360018261813-Frames#Hiding_and_revealing_frames) is only available to board owners and co-owners on Consultant and Enterprise plans.
  If your app attempts to toggle the visibility of content inside a frame with `showContent` for users who are on different subscription plans and who aren't board owners or co-owners, the operation throws an error.

<img alt="" src="https://files.readme.io/b611ee5-frame-hide-1.png" width="500"><br>**Figure 1.** `showContent: true` reveals the content inside the frame.

<img alt="" src="https://files.readme.io/c74027b-frame-hide-2.png" width="500"><br>**Figure 2.** `showContent: false` hides the content inside the frame.

***

### childrenIds

<pre class="sdk-reference-type">Array&lt;string&gt;</pre>

An array of unique identifiers.
The IDs represent child items inside the frame.
They help retrieve child items inside a parent item.

***

### style

<pre class="sdk-reference-type">{ fillColor: string }</pre>

The `style` object groups properties that define the layout, the look and feel of specific elements of an item, when it's displayed on the board.
For example: background color, font family, font type, horizontal and vertical alignment of the text, text color, and so on.

The Miro Web SDK doesn't support all standard style, yet. Additional styles will be included in future releases.

`style` data structure:

#### `fillColor`

[Hex value](https://www.color-hex.com/) representing the [background color](https://htmlcolorcodes.com/) that fills the area of the frame.

Default: no fill (transparent background)

***

### id

<pre class="sdk-reference-type">readonly string</pre>

Unique ID of the item, assigned automatically upon creation.

Example: `3658432978520043388`

***

### x

<pre class="sdk-reference-type">number</pre>

The x-axis coordinate of an item is the horizontal distance in [dp](https://en.wikipedia.org/wiki/Device-independent_pixel) of the center point of the item from the center point of the board.

The center point of the board has `x: 0` and `y: 0` coordinates.

Default: `0`

See also:

* [Board coordinates](https://developers.miro.com/miro-ea/docs/boards#position-and-coordinates)
* [`x` and `y`: `-Infinity`](https://developers.miro.com/miro-ea/docs/children-inside-parent-items#retrieval-of-unsupported-parent-with-children)

***

### y

<pre class="sdk-reference-type">number</pre>

The y-axis coordinate of an item is the vertical distance in [dp](https://en.wikipedia.org/wiki/Device-independent_pixel) of the center point of the item from the center point of the board.

The center point of the board has `x: 0` and `y: 0` coordinates.

Default: `0`

See also:

* [Board coordinates](https://developers.miro.com/miro-ea/docs/boards#position-and-coordinates)
* [`x` and `y`: `-Infinity`](https://developers.miro.com/miro-ea/docs/children-inside-parent-items#retrieval-of-unsupported-parent-with-children)

***

### type

<pre class="sdk-reference-type">readonly 'frame'</pre>

Defines the [type of item](https://developers.miro.com/miro-ea/docs/board-items).
Item type is useful to retrieve specific items from a board. For example, you can fetch all card and shape items from the board, and then carry out an action on them.

Example:

```typescript
// Get all items from the board
const items = await miro.board.get();

// Count all card and shape items on the board
let cards = 0;
let shapes = 0;

items.forEach((items) => {
  switch (items.type) {
    case 'card':
      cards++;
    case 'shape':
      shapes++;
  }
});

// Output to the console the total amount of card and shape items
console.log(`The current board has ${cards} cards and ${shapes} shapes.`);
```

***

### parentId

<pre class="sdk-reference-type">readonly 'null' | string</pre>

If an item is a child of another item, the child's `parentId` returns the unique identifier of the corresponding parent item.
If an item has no parent, its `parentId` is `null`.

You can use the value to retrieve a tree structure when items are nested inside containers.
For example, sticky notes inside frames or text items inside mindmaps.

***

### origin

<pre class="sdk-reference-type">'center'</pre>

`origin` marks:

* The positioning reference point of a board item.
  This is the point used to calculate the `x` and `y` coordinates of an item when it's positioned [on the board](https://developers.miro.com/miro-ea/docs/boards#position-and-coordinates), or when it's a child inside a [parent item](https://developers.miro.com/miro-ea/docs/boards#position-relative-to-parent-items).
* The rotation pivot point of a board item that supports [rotation](#rotation).

`origin` accepts only one value: `center`.
Any other value throws an error.

***

### relativeTo

<pre class="sdk-reference-type">'canvas_center' | 'parent_top_left' | 'parent_center'</pre>

The `relativeTo` property affects the `x` and `y` coordinate values of a board item.
`relativeTo` defines the positioning reference of a board item, which can be:

* [Relative to the board](https://developers.miro.com/miro-ea/docs/boards#position-relative-to-the-board)
* [Relative to a parent item](https://developers.miro.com/miro-ea/docs/boards#position-relative-to-parent-items)

Depending on whether an item is a child of a parent item or not, `relativeTo` can have one of the following values:

| Value             | Description                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                          On the board UI                                                                                                                                                         |
| :---------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `canvas_center`   | The item is positioned on the board, and it's not a child of another item.<br>The `x` and `y` coordinate values of the item are relative to the [center of the board](https://developers.miro.com/miro-ea/docs/boards#position-and-coordinates).                                                                                                                                                  | <img alt="" src="https://files.readme.io/9aa7dad-5_-_Item_positioning_relative_to_the_board.png" width="100%"><br>**Figure 1.** The `relativeTo` property of the board item—a sticky note in the example image—is set to `canvas_center`. The same mechanism applies to and works in the same way for all supported board items. |
| `parent_top_left` | The item is positioned on the board, and it is a child of a parent item. For example, a parent frame.<br>The `x` and `y` coordinate values of the child item are relative to the top-left corner of the [parent item](https://developers.miro.com/miro-ea/docs/boards#position-relative-to-parent-items)).                                                                                        | <img alt="" src="https://files.readme.io/0743949-7_-_Child_positioning_relative_to_parent.png" width="100%"><br>**Figure 2.** The `relativeTo` property of the board item—a sticky note in the example image—is set to `parent_top_left`. The same mechanism applies to and works in the same way for all supported board items. |
| `parent_center`   | **<span><img src="https://files.readme.io/4598fa6-experimental-flask-color.svg" alt="Experimental feature" width="24" ></span> Experimental feature**<br><br>The item is positioned on the board, and it is a child of a parent mind map node.<br>The `x` and `y` coordinate values of the item are relative to the center of the parent mind map node item. |                                                   <img alt="" src="https://files.readme.io/99a12c3-small-relativeTo-parent_center-mind-map-nodes-1600x378.png" width="100%"><br>**Figure 3.** The `relativeTo` property of the child mind map nodes is set to `parent_center`.                                                   |

See also:

* [Position and coordinates](https://developers.miro.com/miro-ea/docs/boards#position-and-coordinates)
* [Children inside parent items](https://developers.miro.com/miro-ea/docs/children-inside-parent-items)

***

### linkedTo?

<pre class="sdk-reference-type">string</pre>

`linkedTo` is the namespace that enables links to be associated to items on the board.

When this property is utilized, the associated item will display an arrow icon on its top right corner. On click, this icon will navigate to the associated link.

For links that point to another item on the same board, the viewport will automatically move to that item when `true` is returned.

For links that point to an item on a separate board or an external url, a new tab tab will be opened.

> **Note:** Items of type `tag` do not support the `linkedTo` property.

To link an item to another item on the same board, a valid url with an item id must be specified:

```typescript
const [geoCard] = await miro.board.get({type: 'card'});

const widgetId = `00000000000000000`;
const boardId = 'xxxxxxxxxxx';

// Generate url based on boardId and widgetId
geoCard.linkedTo = `https://miro.com/app/board/${xxxxxxxxxxx}/?moveToWidget=${widgetId}`;

// OR you can use relative URL
geoCard.linkedTo = `/app/board/${xxxxxxxxxxx}/?moveToWidget=${widgetId}`;

// OR you can generate url based on current URL by simply change of query param
const searchParams = new URLSearchParams(window.location.search);
searchParams.set('moveToWidget', widgetId);
const newRelativePathQuery = `${window.location.pathname}?${searchParams.toString()}`;
geoCard.linkedTo = newRelativePathQuery;
```

To unlink an item to the provided url, set the property to `undefined` or pass an empty string `""`:

```typescript
const [geoCard] = await miro.board.get({type: 'card'});
// Unlink the widget
geoCard.linkedTo = '';
// or
geoCard.linkedTo = undefined;

await geoCard.sync();

console.log(geoCard.linkedTo); // will return empty string: ''
```

***

### createdAt

<pre class="sdk-reference-type">readonly string</pre>

Timestamp

Date and time when the item was created.

Format: UTC, [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601).
Includes a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)).

Example: `2021-05-18T07:59:01Z`

ℹ️ Note:

* Timestamps indicating creation and update times are [always in UTC time](https://time.is/UTC), regardless of the time offset configured on the machine where the app runs or where the code is executed.

***

### createdBy

<pre class="sdk-reference-type">readonly string</pre>

Miro users are automatically assigned a unique ID.

`createdBy` contains the ID of the user who created the item.

Example: `3658432978520043388`

***

### modifiedAt

<pre class="sdk-reference-type">readonly string</pre>

Timestamp

Date and time when the item was last modified.

Format: UTC, [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601).
Includes a [trailing Z offset](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)).

Example: `2021-05-18T07:59:01Z`

ℹ️ Note:

* Timestamps indicating creation and update times are [always in UTC time](https://time.is/UTC), regardless of the time offset configured on the machine where the app runs or where the code is executed.

***

### modifiedBy

<pre class="sdk-reference-type">readonly string</pre>

Miro users are automatically assigned a unique ID.

`modifiedBy` contains the ID of the user who applied the most recent edit to the item.

Example: `3658432978520043388`

## Methods

### add(...)

<pre class="sdk-reference-type">(item: T) =&gt; Promise&lt;T&gt;</pre>

##### 🔒 Requires scope: [boards:write](https://developers.miro.com/reference/scopes#boardswrite "boards:write")

Adds an item to a frame as a child.
The frame becomes the corresponding parent.

The `add()` method takes a [board item](https://developers.miro.com/miro-ea/docs/board-items) as an argument.
To add a board item to a frame with `add()`, the item to add must:

* Exist on the board.
* Be located inside the frame.

`add()` establishes a parent/child relationship between the containing frame and the items inside it.
After calling `add()`:

* The `parentId` of the child item corresponds to the parent frame ID.
* The child item ID is added to the frame `childrenIds` array.
* The `x` and `y` coordinates of the child item are recalculated [relative to the top-left corner of the parent frame](https://developers.miro.com/miro-ea/docs/boards#position-relative-to-parent-items).

This enables repositioning a frame on the board along with its children, as they keep the same relative position inside the parent frame.
It also affects the positioning reference of the child item, because its `x` and `y` values are no longer relative to the center of the board.
After adding an item to a frame, the `x` and `y` coordinates of the child item inside the parent frame mark the center point of the child, [relative to the top-left corner of the parent frame](https://developers.miro.com/miro-ea/docs/boards#position-relative-to-parent-items).

Adding a board item to a frame as a child can fail if:

* The parent frame doesn't exist.
* The child item is located outside the bounds of the parent frame.
* The child item is already a child inside a different frame.

***

### remove(...)

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

##### 🔒 Requires scope: [boards:write](https://developers.miro.com/reference/scopes#boardswrite "boards:write")

Removes a child item from a frame.
The method removes the parent-child relationship between the items.
Both items still exist on the board as independent, detached items.

This affects the positioning reference of the item, because its `x` and `y` values are no longer relative to the top-left corner of the frame.
After removing an item from a frame, the item's `x` and `y` coordinates mark the center point of the item, [relative to the center of the board](https://developers.miro.com/miro-ea/docs/boards#position-relative-to-board).

The `frame.remove()` method takes an [item](https://developers.miro.com/miro-ea/docs/board-items) as an argument.
The promise that the method returns can fail if:

* The child item you're trying to remove doesn't exist.
* The item you're trying to remove isn't a child of the frame.
* The frame doesn't exist.

Example:

```typescript
// Create a frame.
const frame = await miro.board.createFrame({
  title: 'this frame ratio is 16:9',
  style: {
    fillColor: '#FFFFFF',
  },
  width: 800,
  height: 450,
  x: 4100,
  y: 4200,
});

// Create a text item, and position it inside the frame.
const text = await miro.board.createText({
  content: 'this is a piece of text',
  style: {
    fillColor: '#fff9b1', // Light yellow
  },
  x: frame.x + 180,
  y: frame.y + 10,
});

// Create a shape item, and position it inside the frame.
const shape = await miro.board.createShape({
  width: 200,
  height: 250,
  x: frame.x + 20,
  y: frame.y + 50,
  style: {
    fillColor: '#FF0000',
  },
});

// Add the text and the shape items as children of the parent frame.
await frame.add(text);
await frame.add(shape);

// Move the frame on the board.
// The children items move along with the frame:
// their coordinates are relative to the top-left corner of the frame.
frame.x = -400;
frame.y = -500;
await frame.sync();

// Update the child shape position inside the frame
// by specifying relative coordinates.
const shapes = await miro.board.get({type: 'shape'});
await Promise.all(
  shapes.map((child) => {
    child.x += 150;
    child.y += 200;
    return child.sync();
  }),
);

// Remove the parent/child relationship between frame and text item.
await frame.remove(text);

// Move the frame on the board.
// The text item doesn't move along with the frame:
// its coordinates are relative to the center of the board.
frame.x += 400;
frame.y += 500;
await frame.sync();

// Remove the text item from the board
await miro.board.remove(text);

// Remove the frame from the board
await miro.board.remove(frame);
```

***

### getChildren(...)

<pre class="sdk-reference-type">() =&gt; Promise&lt;Array&lt;ContainableItem&gt;&gt;</pre>

##### 🔒 Requires scope: [boards:read](https://developers.miro.com/reference/scopes#boardsread "boards:read")

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

Returns an array containing all the child items inside a parent frame.
If a frame has no children, the method returns an empty array.

Example:

```typescript
// Specify all frame items on the board
let frames = await miro.board.get({type: 'frame'});

// Log to the console the child items of the frames
for (const frame of frames) {
  const children = await frame.getChildren();
  console.log(children);
}
```

***

### sync

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

##### 🔒 Requires scope: [boards:write](https://developers.miro.com/reference/scopes#boardswrite "boards:write")

`sync` propagates to the board any changes to item and tag properties.
After updating the properties of an item or a tag, sync it with the board to:

* Propagate to the board the changes applied to the item or to the tag.
* Make the changes visible on the board.

All board items and tags require `sync` to make any changes to their properties visible on the board.

For more information and examples, see [Update and sync item properties](https://developers.miro.com/miro-ea/docs/update-and-sync-item-properties).

Example:
*(The code example updates a text item using `sync`.
The same mechanism applies to and works in the same way for all supported board items.)*

```typescript
// Create an item.
// In this case, a text item.
const text = await miro.board.createText({
  content: '<p>This is a piece of text to remind me that I always finish what I ...</p>',
  style: {
    fillColor: 'transparent',
    textAlign: 'left',
  },
  x: 0,
  y: 0,
  width: 450,
  rotation: 0.0,
});

// Update the board item by modifying the values of its properties.
// In the text item case, the updated properties modify content, background color, and rotation of the item.
text.content = 'A fourteneer is "A line that rumbles on like this for being a bit too long."';
text.style.fillColor = '#a9fe65';
text.rotation = 180.0;

// Call 'sync' to make the changed board item properties visible on the board.
await text.sync();

// Output the updated board item to the developer console.
console.log(text);
```

Example:
*(The code example updates a tag using `sync`.
The same mechanism applies to and works in the same way for all supported board items.)*

```typescript
// Create a tag.
const todo = await miro.board.createTag({
  title: 'todo',
  color: 'yellow',
});

// Create a sticky note and attach the tag to it.
const stickyNote = await miro.board.createStickyNote({
  content: 'sticky note with tag: "todo"',
  tagIds: [todo.id],
});
console.log(stickyNote.tagIds); // => ['3074457345627244742']

// Update the tag properties: title and color.
todo.title = "won't fix";
todo.color = 'green';

// Call 'sync' to make the changed tag properties visible on the board.
await todo.sync();

// Output the updated tag to the developer console.
console.log(todo);
```

***

### getMetadata

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

##### 🔒 Requires scope: [boards:read](https://developers.miro.com/reference/scopes#boardsread "boards:read")

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

Fetches board item metadata, stored per app, for the specified metadata key.
The response contains the metadata value assigned to the requested key.

To fetch all the metadata for a board item, invoke the method without passing any arguments.
The response contains all the metadata associated with the board item as key/value pairs.

An app can access only the metadata that it sets.
It cannot access metadata set by other apps.

[`getMetadata`](https://developers.miro.com/miro-ea/docs/websdk-reference-board#getMetadata) and [`setMetadata`](https://developers.miro.com/miro-ea/docs/websdk-reference-board#setMetadata) are available for the following board items:

* Card
* Connector
* Embed
* Image
* Preview
* Shape
* Sticky note
* Text

The methods aren't available for the following board items:

* Frames
* [Unsupported board items](https://developers.miro.com/miro-ea/docs/websdk-reference-unsupported#)
* [groups](https://developers.miro.com/miro-ea/docs/websdk-reference-group#)

ℹ️ Note:

* To [access board item metadata](https://developers.miro.com/miro-ea/docs/websdk-reference-board#getMetadata), apps require the [`boards:read`](https://developers.miro.com/miro-ea/reference/scopes) permission.
* To [store board item metadata](https://developers.miro.com/miro-ea/docs/websdk-reference-board#setMetadata), apps require the [`boards:write`](https://developers.miro.com/miro-ea/reference/scopes) permission.
* `getMetadata` returns a new object, not a reference to the object that was previously set with [`setMetadata`](https://developers.miro.com/miro-ea/docs/websdk-reference-board#setMetadata).
* If the specified key isn't found, the method returns `undefined`.

⚠️ Warning:

* Total `ItemMetadata` storage limit: `6 KB` per item.

Example:

```typescript
// Get the board item you want to retrieve metadata from.
const [geoCard] = await miro.board.get({type: 'card'});

// Set item metadata for an imaginary geocaching game, and store it to the retrieved card item.
await geoCard.setMetadata('leaderboard', ['Ziltoid', 'Howard', 'Paul']);

// Get the specific 'leaderboard' metadata from the card item.
const leaderboard = await geoCard.getMetadata('leaderboard');

// Get all the metadata from the card item by passing no arguments.
await geoCard.getMetadata();
```

***

### setMetadata

<pre class="sdk-reference-type">(key: string, value: <a href="#json" <a href="#title" title="title">title</a>="Json">Json</a>) =&gt; Promise&lt;T&gt;</pre>

##### 🔒 Requires scope: [boards:write](https://developers.miro.com/reference/scopes#boardswrite "boards:write")

Adds board item metadata to make it available on the board that the app runs on.
An app can access only the board item metadata that it sets.
It cannot access metadata set by other apps.

Board item metadata is stored in the item it refers to. Therefore:

* When duplicating an item, the metadata is copied to the new item.
* When deleting an item, the corresponding metadata is removed with the deleted item.

Board item metadata is synced across, and available to, all the users who can:

* Access and view the board that the app is running on, AND
* Run the app on the board.

`ItemMetadata` is a key/value-pair object. It can contain values with the following data types:

* `string`
* `number`
* `boolean`
* `Object`
* `Array`
* `null`
* `undefined`

[`getMetadata`](https://developers.miro.com/miro-ea/docs/websdk-reference-board#getMetadata) and [`setMetadata`](https://developers.miro.com/miro-ea/docs/websdk-reference-board#setMetadata) are available for the following board items:

* Card
* Connector
* Embed
* Image
* Preview
* Shape
* Sticky note
* Text

The methods aren't available for the following board items:

* Frames
* [Unsupported board items](https://developers.miro.com/miro-ea/docs/websdk-reference-unsupported#)
* [groups](https://developers.miro.com/miro-ea/docs/websdk-reference-group#)

To overwrite an existing key inside `ItemMetadata`:

* Pass the same key multiple times with different values. Only the last/most recent value is stored with the key.

To remove a key from `ItemMetadata`:

* Set the value of the existing key to either `null`, or `undefined`.
  This clears the key. If you call `getMetadata(key)` to retrieve a key that has been set to `null` or `undefined`, the method returns `undefined`.

ℹ️ Note:

* To [access board item metadata](https://developers.miro.com/miro-ea/docs/websdk-reference-board#getMetadata), apps require the [`boards:read`](https://developers.miro.com/miro-ea/reference/scopes) permission.
* To [store board item metadata](https://developers.miro.com/miro-ea/docs/websdk-reference-board#setMetadata), apps require the [`boards:write`](https://developers.miro.com/miro-ea/reference/scopes) permission.
* You can assign an empty array (`[]`) to a key. It's returned as an empty array.
* You can assign an empty string (`''`) to a key. It's returned as an empty string.

⚠️ Warning:

* Total `ItemMetadata` storage limit: `6 KB` per item.

Example:

```typescript
// Get the board item you want to set metadata to.
const [geoCard] = await miro.board.get({type: 'card'});

// Set item metadata for an imaginary geocaching game, and store it to the retrieved card item.
await geoCard.setMetadata('geoData', {
  name: 'null',
  coordinates: {
    latitude: '33.950278',
    longitude: '-105.314167',
  },
  lastFound: '1947-07-08',
  content: true,
  difficulty: 5,
  keywords: ['x-files', 'truth-is-out-there', 'area-51', 'roswell', 'aliens'],
  geoCache: [
    {
      name: 'UFO',
      description: 'Severely damaged unidentified flying object. ',
    },
    {
      name: 'Alien',
      description: 'Remains of an alien life form.',
    },
    {
      name: 'Artifacts',
      description: 'Tools, equipment, and other items found at the crash site.',
    },
    {
      name: 'Edibles',
      description: 'The alien was likely as high as a kite when they crashed. Typical.',
    },
  ],
});

// Get the specific 'geoData' metadata from the card item.
// The response contains the metadata value assigned to the key.
const geoCardGeoData = await geoCard.getMetadata('geoData');

// Get all the metadata from the card item.
// The response contains all the metadata assigned to the board item as key/value pairs.
const geoCardAllMetaData = await geoCard.getMetadata();

// Clear the metadata about the imaginary geocaching game in one of the following ways:
// 1. Assign 'geoData' an empty object.
await miro.board.setMetadata('geoData', {});
// 2. Set 'geoData' to 'undefined'.
await miro.board.setMetadata('geoData', undefined);
// 3. Set 'geoData' to 'null'.
await miro.board.setMetadata('geoData', null);
```

***

### goToLink

<pre class="sdk-reference-type">() =&gt; Promise&lt;boolean&gt;</pre>

##### 🔒 Requires scope: [boards:read](https://developers.miro.com/reference/scopes#boardsread "boards:read")

`goToLink` navigates to the provided link associated with the item on a board.

For links that point to another item on the same board, the viewport will automatically move to that item when `true` is returned.

For links that point to an item on a separate board or an external url, a new tab tab will be opened.

Returns:

`Promise`<`boolean`>

* `true`: Link is successfully associated with the item, navigation is triggered, and the `linkedTo` property contains a valid value.
* `false`: Link is not successfully associated to the item due to an invalid or missing `linkedTo` property, and no navigation is triggered.

Example:

```typescript
const [geoCard] = await miro.board.get({type: 'card'});

// Link item to some url
geoCard.linkedTo = 'https://google.com';

// Update widget props and apply changes
await geoCard.sync();

// Navigate to https://google.com (value of `linkedTo` property)
await geoCard.goToLink();
```

***

### bringToFront

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

##### 🔒 Requires scope: [boards:write](https://developers.miro.com/reference/scopes#boardswrite "boards:write")

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

In a stack of items, this method brings an item to the front so that it is at the top of the stack.
When the item is at the front, it is fully visible; The item can partially or completely hide underlying items in the same stack.

ℹ️ Note:

* [Frame](https://developers.miro.com/miro-ea/docs/websdk-reference-frame#) items don't support the `bringToFront()` method.
  As a frame item acts as a parent that can contain other items, a frame item is always at the back, relative to any other items on the board.
  The only object behind a frame is the board itself.

Example:

```typescript
// Create three sticky notes
const first = await miro.board.createStickyNote({
  content: 'first',
});

const second = await miro.board.createStickyNote({
  content: 'second',
});

const third = await miro.board.createStickyNote({
  content: 'third',
});

// Bring the first sticky note to the front of the board.
await first.bringToFront();
```

***

### sendToBack

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

##### 🔒 Requires scope: [boards:write](https://developers.miro.com/reference/scopes#boardswrite "boards:write")

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

In a stack of items, it sends an item to the back so that it is at the bottom of the stack.
When it is at the back, item is partially or completely hidden by overlying items in the same stack.

ℹ️ Note:

* [Frame](https://developers.miro.com/miro-ea/docs/websdk-reference-frame#) items don't support the `sendToBack()` method.
  As a frame item acts as a parent that can contain other items, a frame item is always at the back, relative to any other items on the board.
  The only object behind a frame is the board itself.

Example:

```typescript
// Create three sticky notes
const first = await miro.board.createStickyNote({
  content: 'first',
});

const second = await miro.board.createStickyNote({
  content: 'second',
});

const third = await miro.board.createStickyNote({
  content: 'third',
});

// Send the third sticky note to the back of the board
await third.sendToBack();
```

***

### bringInFrontOf

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

##### 🔒 Requires scope: [boards:write](https://developers.miro.com/reference/scopes#boardswrite "boards:write")

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

In a stack of items, this method sends an item in front of another item (target).
When an item is moved to the front, the item can partially or completely hide underlying items in the same stack.

ℹ️ Note:

* As this method implements relative positioning, you can use this method to place items in front or behind other items.
  If you want to send an item all the way to the front,
  you can use the method [`bringToFront()`](#bringtofront), which places the item at the top of the stack.
* [Frame](https://developers.miro.com/miro-ea/docs/websdk-reference-frame#) items don't support the `bringInFrontOf()` method.
  As a frame item acts as a parent that can contain other items, a frame item is always at the back, relative to any other items on the board.
  The only object behind a frame is the board itself.

Example:

```typescript
// Create three sticky notes
const first = await miro.board.createStickyNote({
  content: 'first',
});

const second = await miro.board.createStickyNote({
  content: 'second',
});

const third = await miro.board.createStickyNote({
  content: 'third',
});

// Bring the first sticky note in front of second.
await first.bringInFrontOf(second);
```

***

### sendBehindOf

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

##### 🔒 Requires scope: [boards:write](https://developers.miro.com/reference/scopes#boardswrite "boards:write")

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

In a stack of items, this method sends an item behind another item (target).
When an item is moved to the back, the item can be partially or completely hidden by the overlying items in the top of the same stack.

ℹ️ Note:

* As this method implements relative positioning, you can use this method to place items in front or behind other items.
  If you want to send an item all the way to the back,
  you can use the method [`sendToBack()`](#sendtoback), which places the item at the bottom of the stack.
* [Frame](https://developers.miro.com/miro-ea/docs/websdk-reference-frame#) items don't support the `sendBehindOf()` method.
  As a frame item acts as a parent that can contain other items, a frame item is always at the back, relative to any other items on the board.
  The only object behind a frame is the board itself.

Example:

```typescript
// Create three sticky notes
const first = await miro.board.createStickyNote({
  content: 'first',
});

const second = await miro.board.createStickyNote({
  content: 'second',
});

const third = await miro.board.createStickyNote({
  content: 'third',
});

// Send the third sticky note behind the second one
await third.sendBehindOf(second);
```

***

### getLayerIndex

<pre class="sdk-reference-type">() =&gt; Promise&lt;number&gt;</pre>

##### 🔒 Requires scope: [boards:read](https://developers.miro.com/reference/scopes#boardsread "boards:read")

The `getLayerIndex()` method returns the position of an item in the item stack.

Items in a stack are layered on top of each other based on their layer index value. An item with a higher layer index appears above items with lower layer index values.

Each item on the board has a layer index position in the stack. The higher the layer index value, the "closer" to the user the item appears.

For example, with three items on the board - `first`, `second`, and `third` - their initial layer index values might be:
`first[0]`, `second[1]`, `third[2]`.

The item with `layerIndex === 2` (`third`) will be fully visible at the top of the stack. The item with `layerIndex === 1` (`second`) may be partially hidden by the item above it. And the item with `layerIndex === 0` (`first`) may be fully hidden by the items above it.

Returns:

* `Promise<number>` - calling `getLayerIndex()` allows you get the position of a specific item in the stack.

ℹ️ Note:

* The item stack is zero indexed.
* [Frame](https://developers.miro.com/miro-ea/docs/websdk-reference-frame#) items don't support the `getLayerIndex()` method.
  As a frame item acts as a parent that can contain other items, a frame item is always at the back, relative to any other items on the board.
  The only object behind a frame is the board itself.

Example:

```typescript
// Create three sticky notes.
// Sticky notes are created on top of each other in the creation order, with the layer index equal to the creation index.
const first = await miro.board.createStickyNote({
  content: 'first',
});

const second = await miro.board.createStickyNote({
  content: 'second',
});

const third = await miro.board.createStickyNote({
  content: 'third',
});

await third.getLayerIndex(); // returns 2
```

***

### getConnectors

<pre class="sdk-reference-type">() =&gt; Promise&lt;Array&lt;<a href="websdk-reference-connector" title="Connector">Connector</a>&gt;&gt;</pre>

##### 🔒 Requires scope: [boards:read](https://developers.miro.com/reference/scopes#boardsread "boards:read")

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

The `getConnectors()` method returns an array of connector items attached to the current item. The connectors returned correspond to the ids in the `connectorIds` property of the item.

Example:

```typescript
// Create two sticky notes linked by a connector.
const startItem = await miro.board.createStickyNote({
  content: 'start',
});

const endItem = await miro.board.createStickyNote({
  content: 'end',
  x: 500,
});

const connector = await miro.board.createConnector({
  start: {
    item: startItem.id,
  },
  end: {
    item: endItem.id,
  },
});

// sync() updates the connectorIds property in startItem
await startItem.sync();

const connectors = await startItem.getConnectors(); // returns [connector]
```

## All properties

<table><tr><th>Property</th><th>Type</th></tr>
<tr>
  <td><code>childrenIds</code></td>
  <td>
    <pre class="sdk-reference-type">Array&lt;string&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>connectorIds?</code></td>
  <td>
    <pre class="sdk-reference-type">readonly Array&lt;string&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>createdAt</code></td>
  <td>
    <pre class="sdk-reference-type">readonly string</pre>
  </td>
</tr>
<tr>
  <td><code>createdBy</code></td>
  <td>
    <pre class="sdk-reference-type">readonly string</pre>
  </td>
</tr>
<tr>
  <td><code>groupId?</code></td>
  <td>
    <pre class="sdk-reference-type">readonly string</pre>
  </td>
</tr>
<tr>
  <td><code>height</code></td>
  <td>
    <pre class="sdk-reference-type">number</pre>
  </td>
</tr>
<tr>
  <td><code>id</code></td>
  <td>
    <pre class="sdk-reference-type">readonly string</pre>
  </td>
</tr>
<tr>
  <td><code>linkedTo?</code></td>
  <td>
    <pre class="sdk-reference-type">string</pre>
  </td>
</tr>
<tr>
  <td><code>modifiedAt</code></td>
  <td>
    <pre class="sdk-reference-type">readonly string</pre>
  </td>
</tr>
<tr>
  <td><code>modifiedBy</code></td>
  <td>
    <pre class="sdk-reference-type">readonly string</pre>
  </td>
</tr>
<tr>
  <td><code>origin</code></td>
  <td>
    <pre class="sdk-reference-type">'center'</pre>
  </td>
</tr>
<tr>
  <td><code>parentId</code></td>
  <td>
    <pre class="sdk-reference-type">readonly 'null' | string</pre>
  </td>
</tr>
<tr>
  <td><code>relativeTo</code></td>
  <td>
    <pre class="sdk-reference-type">'canvas_center' | 'parent_top_left' | 'parent_center'</pre>
  </td>
</tr>
<tr>
  <td><code>showContent</code></td>
  <td>
    <pre class="sdk-reference-type">boolean</pre>
  </td>
</tr>
<tr>
  <td><code>style</code></td>
  <td>
    <pre class="sdk-reference-type">{ fillColor: string }</pre>
  </td>
</tr>
<tr>
  <td><code>title</code></td>
  <td>
    <pre class="sdk-reference-type">string</pre>
  </td>
</tr>
<tr>
  <td><code>type</code></td>
  <td>
    <pre class="sdk-reference-type">readonly 'frame'</pre>
  </td>
</tr>
<tr>
  <td><code>width</code></td>
  <td>
    <pre class="sdk-reference-type">number</pre>
  </td>
</tr>
<tr>
  <td><code>x</code></td>
  <td>
    <pre class="sdk-reference-type">number</pre>
  </td>
</tr>
<tr>
  <td><code>y</code></td>
  <td>
    <pre class="sdk-reference-type">number</pre>
  </td>
</tr>
<tr>
  <td><code>add(...)</code></td>
  <td>
    <pre class="sdk-reference-type">(item: T) =&gt; Promise&lt;T&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>bringInFrontOf(...)</code></td>
  <td>
    <pre class="sdk-reference-type">(target: BaseItem) =&gt; Promise&lt;void&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>bringToFront(...)</code></td>
  <td>
    <pre class="sdk-reference-type">() =&gt; Promise&lt;void&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>getAiContext(...)</code></td>
  <td>
    <pre class="sdk-reference-type">() =&gt; Promise&lt;string&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>getChildren(...)</code></td>
  <td>
    <pre class="sdk-reference-type">() =&gt; Promise&lt;Array&lt;ContainableItem&gt;&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>getConnectors(...)</code></td>
  <td>
    <pre class="sdk-reference-type">() =&gt; Promise&lt;Array&lt;<a href="websdk-reference-connector" title="Connector">Connector</a>&gt;&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>getLayerIndex(...)</code></td>
  <td>
    <pre class="sdk-reference-type">() =&gt; Promise&lt;number&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>getMetadata(...)</code></td>
  <td>
    <pre class="sdk-reference-type">(key: string) =&gt; Promise&lt;T&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>goToLink(...)</code></td>
  <td>
    <pre class="sdk-reference-type">() =&gt; Promise&lt;boolean&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>remove(...)</code></td>
  <td>
    <pre class="sdk-reference-type">(item: T) =&gt; Promise&lt;void&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>sendBehindOf(...)</code></td>
  <td>
    <pre class="sdk-reference-type">(target: BaseItem) =&gt; Promise&lt;void&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>sendToBack(...)</code></td>
  <td>
    <pre class="sdk-reference-type">() =&gt; Promise&lt;void&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>setMetadata(...)</code></td>
  <td>
    <pre class="sdk-reference-type">(key: string, value: <a href="#json" <a href="#title" title="title">title</a>="Json">Json</a>) =&gt; Promise&lt;T&gt;</pre>
  </td>
</tr>
<tr>
  <td><code>sync(...)</code></td>
  <td>
    <pre class="sdk-reference-type">() =&gt; Promise&lt;void&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)
* [Custom Action Management](https://developers.miro.com/miro-ea/docs/websdk-reference-custom-action-management.md)
* [Shape](https://developers.miro.com/miro-ea/docs/websdk-reference-shape.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)