/miro-pack:miro-upgrade-migrationfrom miro-pack
Migrates Miro integrations from REST API v1 to v2 and upgrades @mirohq/miro-api SDK. Handles breaking changes, endpoint migration, and terminology updates.
Ships in miro-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Guide for migrating from Miro REST API v1 to v2, upgrading the @mirohq/miro-api SDK, and handling the key breaking changes between versions.
| v1 Term | v2 Term | Notes |
|---|---|---|
| Widget | Item | All board elements renamed |
| Line | Connector | Lines renamed, gained captions and snapTo |
| Sticker | Sticky Note | Type value: sticky_note |
| Widget API (polymorphic) | Per-type endpoints | No more universal create endpoint |
text property | content property | In data objects |
shapeType | shape (in data) | Moved from style to data object |
startWidget / endWidget | startItem / endItem | Connector endpoints |
| Board User Connection | Board Member | Sharing/permissions model |
# v1 (DEPRECATED) → v2 (CURRENT)
POST /v1/boards/{id}/widgets → POST /v2/boards/{id}/sticky_notes
POST /v2/boards/{id}/shapes
POST /v2/boards/{id}/cards
POST /v2/boards/{id}/texts
POST /v2/boards/{id}/frames
POST /v2/boards/{id}/images
POST /v2/boards/{id}/documents
POST /v2/boards/{id}/embeds
POST /v2/boards/{id}/app_cards
GET /v1/boards/{id}/widgets → GET /v2/boards/{id}/items
GET /v1/boards/{id}/widgets/{widget_id} → GET /v2/boards/{id}/items/{item_id}
(or type-specific: /v2/boards/{id}/sticky_notes/{item_id})
POST /v1/boards/{id}/widgets (type: line) → POST /v2/boards/{id}/connectors
GET /v1/boards/{id}/widgets?type=line → GET /v2/boards/{id}/connectors
// v1: Create a sticky note (via universal widgets endpoint)
// POST /v1/boards/{id}/widgets
{
"type": "sticker",
"text": "Hello World",
"style": {
"stickerBackgroundColor": "#FFFF00"
},
"x": 100,
"y": 200,
"width": 200
}
// v2: Create a sticky note (dedicated endpoint)
// POST /v2/boards/{id}/sticky_notes
{
"data": {
"content": "Hello World", // "text" → "content"
"shape": "square" // Required in v2
},
"style": {
"fillColor": "light_yellow" // Named colors or hex
},
"position": {
"x": 100, // Nested under "position"
"y": 200
},
"geometry": {
"width": 200 // Nested under "geometry"
}
}
// v1: Connector (line)
{
"type": "line",
"startWidget": { "id": "123" },
"endWidget": { "id": "456" }
}
// v2: Connector
{
"startItem": { "id": "123", "snapTo": "right" }, // Gains snapTo/position
"endItem": { "id": "456", "snapTo": "left" },
"captions": [{ "content": "connects to" }], // New: captions
"shape": "curved", // New: shape control
"style": {
"startStrokeCap": "none",
"endStrokeCap": "stealth"
}
}
# Check current version
npm list @mirohq/miro-api
# View available versions
npm view @mirohq/miro-api versions --json | tail -5
# Create upgrade branch
git checkout -b upgrade/miro-api-v2
# Install latest
npm install @mirohq/miro-api@latest
// OLD: Some early SDK versions
import { MiroClient } from '@miro/sdk';
// CURRENT: Official @mirohq/miro-api
import { Miro, MiroApi } from '@mirohq/miro-api';
// High-level (OAuth-aware, stateful)
const miro = new Miro({ clientId, clientSecret, redirectUrl });
const userApi = await miro.as(userId);
// Low-level (stateless, pass token)
const api = new MiroApi(accessToken);
// BEFORE: Generic widget create
const widget = await client.createWidget(boardId, {
type: 'sticker',
text: 'Note content',
});
// AFTER: Type-specific item create
const stickyNote = await fetch(
`https://api.miro.com/v2/boards/${boardId}/sticky_notes`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
data: { content: 'Note content', shape: 'square' },
style: { fillColor: 'light_yellow' },
position: { x: 0, y: 0 },
}),
}
);
// v1 response: flat structure
// { id, type, text, x, y, width, style: { stickerBackgroundColor } }
// v2 response: nested structure
// {
// id, type: 'sticky_note',
// data: { content, shape },
// style: { fillColor, textAlign },
// position: { x, y, origin },
// geometry: { width },
// createdAt, modifiedAt, createdBy
// }
// Adapter for gradual migration
function adaptV2ToV1Shape(v2Item: any): any {
return {
id: v2Item.id,
type: v2Item.type === 'sticky_note' ? 'sticker' : v2Item.type,
text: v2Item.data?.content,
x: v2Item.position?.x,
y: v2Item.position?.y,
width: v2Item.geometry?.width,
};
}
# Run tests
npm test
# Verify against a test board
MIRO_TEST_BOARD_ID=your-test-board npm run test:integration
# Check for any remaining v1 patterns
grep -r "widgets\|sticker\|startWidget\|endWidget\|shapeType" src/ --include="*.ts"
// v1: offset-based pagination
// GET /v1/boards/{id}/widgets?offset=100&limit=50
// v2: cursor-based pagination
// GET /v2/boards/{id}/items?limit=50&cursor=eyJ0...
async function getAllItemsV2(boardId: string): Promise<any[]> {
const items: any[] = [];
let cursor: string | undefined;
do {
const url = new URL(`https://api.miro.com/v2/boards/${boardId}/items`);
url.searchParams.set('limit', '50');
if (cursor) url.searchParams.set('cursor', cursor);
const response = await fetch(url.toString(), {
headers: { 'Authorization': `Bearer ${token}` },
});
const result = await response.json();
items.push(...result.data);
cursor = result.cursor;
} while (cursor);
return items;
}
| Issue | Detection | Solution |
|---|---|---|
Cannot find module '@miro/sdk' | Import error | Update to @mirohq/miro-api |
widgets is not a function | SDK API change | Use per-type endpoints |
text field undefined | v2 response shape | Access via data.content |
| Connector fails | v1 line syntax | Update to startItem/endItem |
| Position wrong | Flat vs nested | Wrap in position: { x, y } |
For CI integration during upgrades, see miro-ci-integration.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
24 skills in this plugin
/miro-ci-integrationConfigure CI/CD pipelines for Miro REST API v2 integrations with GitHub Actions,
test board isolation, and automated validation.
Trigger with phrases like "miro CI", "miro GitHub Actions",
"miro automated tests", "CI miro", "miro pipeline".
/miro-common-errorsDiagnose and fix Miro REST API v2 errors by HTTP status code.
Use when encountering Miro API errors, debugging failed requests,
or troubleshooting authentication and permission issues.
Trigger with phrases like "miro error", "fix miro",
"miro not working", "debug miro", "miro 401", "miro 403", "miro 429".
/miro-core-workflow-aManage Miro boards and items — create, read, update, delete boards,
sticky notes, shapes, cards, frames, and tags via REST API v2.
Trigger with phrases like "miro board management", "create miro board",
"miro items CRUD", "miro sticky notes", "organize miro board".
/miro-core-workflow-bManage Miro connectors, images, embeds, app cards, and document items via REST API v2.
Use for visual workflows, embedding content, and building rich board layouts.
Trigger with phrases like "miro connectors", "miro embed",
"miro app card", "miro image upload", "connect miro items".
/miro-cost-tuningOptimize Miro API costs through credit monitoring, request reduction,
and plan selection based on the credit-based rate limiting model.
Trigger with phrases like "miro cost", "miro billing",
"reduce miro costs", "miro pricing", "miro credits usage".
/miro-data-handlingImplement Miro REST API v2 data handling with PII detection in board content,
data export via API, retention policies, and GDPR/CCPA compliance patterns.
Trigger with phrases like "miro data", "miro PII",
"miro GDPR", "miro data export", "miro privacy", "miro compliance".
npx claudepluginhub flight505/skill-forge --plugin miro-packOther plugins' skills for the same job