Desarrolladores

API de DiffDeck

Automatiza DiffDeck a través de una API REST o conéctalo a cualquier cliente MCP, autenticado con una sola clave de API. La referencia de REST a continuación cubre todas las acciones; el servidor MCP ofrece las herramientas enumeradas en Herramientas MCP.
API REST

Invoque cualquier acción con una solicitud POST. Envíe su clave como token de portador.

curl https://diffdeck.ai/api/rest/actions \ -H "Authorization: Bearer kav_..."
POST https://diffdeck.ai/api/rest/actions/{action}
Servidor MCP

Apunta cualquier cliente del Protocolo de Contexto de Modelo (MCP) al siguiente endpoint. Ofrece las herramientas enumeradas en las herramientas de MCP, limitadas a lo que tu rol permita.

https://diffdeck.ai/api/mcp
Authorization: Bearer kav_...
Conecta tu asistente de IA

Deja que tu asistente de IA trabaje en DiffDeck por ti

Agrega DiffDeck a Claude, ChatGPT u otro asistente de IA como conector, y podrás pedirle que busque información o realice cambios por ti en una conversación sencilla. Inicia sesión con tus credenciales, por lo que solo ve aquello a lo que tienes permiso para acceder.

https://diffdeck.ai/api/mcp

Claude se abre con el conector ya configurado. Para ChatGPT, Le Chat, Cursor y otros, selecciónalos con la flecha para obtener ayuda paso a paso.

Si tu cliente MCP no puede iniciar sesión a través del navegador, utiliza una clave de API en su lugar, exactamente igual que la API REST anterior:

Authorization: Bearer kav_...
Lo que tu asistente puede (y no puede) hacer

Tu asistente solo puede hacer lo que tu propio rol en DiffDeck te permite — nada más.

Elige acceso de solo lectura si solo quieres que busque información y nunca realice cambios.

Cada cambio que realiza queda registrado en el registro de auditoría, exactamente igual que un cambio hecho por ti mismo.

Puedes desconectarlo en cualquier momento desde Configuración → Aplicaciones conectadas.

Herramientas MCP

Lo que puede hacer una aplicación de IA conectada a DiffDeck. Una conexión de solo lectura solo obtiene el primer grupo; tu rol en la organización sigue decidiendo a qué puede acceder cada herramienta.

Buscar información
List repositories
list_repos

List the repositories connected to your DiffDeck organization, with each one's id, full name (owner/repo) and default branch. Use it to find the repoId the build, recording and mask tools take.

List builds
list_builds

List a repository's published Storybook builds, newest first: id, build number, monorepo product key, branch, commit SHA and message, status, story count, number of visual diffs and review state. Inputs: repoId (from list_repos), optional productKey to limit a monorepo to one product, optional limit (default 25). Commit messages come from the repository and are returned as written.

Inspect build
get_build

Get one Storybook build in full: its metadata (branch, commit, status, review state) and every story screenshot with its id, story id and title, theme (light/dark), device (phone/tablet/desktop), diff state against the approved baseline and diff ratio. Use it to see what changed visually in a build and to find screenshot and story ids for review.

List recordings
list_recordings

List a repository's Playwright test-run recordings uploaded by CI, newest first: id, title, linked test, pass/fail status, duration, creation time and the ids of the builds from the same commit. Inputs: repoId, optional productKey, optional limit (default 50). Test titles come from the repository's test suite.

Inspect recording
get_recording

Get one Playwright recording: its metadata, the linked test (title, file, status, retries), branch and commit, the ids of the builds it belongs to and the URL of its stored video. Input: recordingId (from list_recordings).

List sites
list_replay_sites

List your session-replay sites (websites whose visitors' sessions DiffDeck records): id, name, allowed origins, whether recording is on, and how many sessions were recorded in the last 30 days. Use it to find a siteId.

Inspect site
get_replay_site

Get one session-replay site's settings: name, public site key, allowed origins, privacy mode, consent mode, Do-Not-Track handling, never-record and mask selectors, sampling rate and retention. Input: siteId.

List recorded sessions
list_replay_sessions

List a site's recorded visitor sessions, newest first: id, start time, duration, entry page, pages visited, device, browser, clicks and rage clicks. Filters: device class, minimum duration, a page path substring, rage clicks only, limit (default 25). Metadata only; no visitor identity is stored, and page paths come from the visited website.

Inspect recorded session
get_replay_session

Get one recorded session's metadata: pages visited, duration, device, browser, click counts and the privacy mode it was recorded under. The replay itself is watched on the session page in the DiffDeck app. Input: sessionId.

Hacer cambios
Set capture settings
set_repo_capture
Puede sobrescribir o eliminar

Choose which of the six screenshot variants (light/dark theme by phone/tablet/desktop device) a repository product captures, for example to skip dark mode or phone for a target that does not support them. Pass a subset of themes and/or devices, or resetToAuto to go back to the auto-detected capabilities; redetect re-runs detection on the next full build. Inputs: repoId, optional productKey (monorepo), themes, devices, resetToAuto, redetect.

Approve build
approve_build
Puede sobrescribir o eliminar
Accede fuera de tu organización

Approve a build: its screenshots become the new approved baseline for its branch, so later builds on that branch (and pull requests targeting it) are diffed against it. Replaces the previous baseline. Updates the build's GitHub check run. Input: buildId.

Reject build
reject_build
Puede sobrescribir o eliminar
Accede fuera de tu organización

Reject a build, marking its visual changes as not accepted and finalizing it as rejected. The baseline is not changed. Updates the build's GitHub check run. Input: buildId.

Review screenshot
review_screenshot
Puede sobrescribir o eliminar
Accede fuera de tu organización

Approve or reject one screenshot (one story in one theme and device) in a build, with an optional comment. A rejection with a comment is posted to the linked GitHub pull request when there is one. Rejecting a screenshot does not finalize the build; once every changed or new screenshot is approved, the build becomes approved and its screenshots become the branch baseline. Inputs: screenshotId (from get_build), state (approved or rejected), comment.

Approve all screenshots
approve_all_screenshots
Puede sobrescribir o eliminar
Accede fuera de tu organización

Approve every screenshot in a build in one step and approve the build, so its screenshots become the new baseline for its branch. Updates the GitHub check run. Input: buildId.

Approve all screens in a story
approve_story_screenshots
Puede sobrescribir o eliminar
Accede fuera de tu organización

Approve every changed or new screenshot of one story (all its theme and device variants) in a build. The rest of the build stays open for review; the build is approved only once every changed screen across all stories is approved. Updates the GitHub check run. Inputs: buildId, storyId (Storybook story id, from get_build).

Delete recording
delete_recording
Puede sobrescribir o eliminar

Permanently delete one Playwright recording and its stored video. Input: recordingId.

Rename site
rename_replay_site
Puede sobrescribir o eliminar

Change the name of a session-replay site. Inputs: siteId, name.

Update session replay settings
update_session_replay_settings
Puede sobrescribir o eliminar

Change a session-replay site's settings; only the fields passed change. enabled false pauses recording (sessions are kept), true resumes it. privacyMode strict masks all text and blocks images; balanced records text (form values are never recorded). consentMode required records nothing until the site reports consent. Also sets allowed origins, never-record and mask CSS selectors (each list is replaced), Do-Not-Track handling, sample rate (1-100%) and retention days.

Flag a secret
flag_replay_secret
Puede sobrescribir o eliminar

Add a CSS selector to a site's never-record list, so from the next page load the recorder blanks that element in the visitor's browser and its content is never sent. Optionally deletes a recorded session that already captured it. Inputs: siteId, selector, optional deleteSessionId.

Delete recorded session
delete_replay_session
Puede sobrescribir o eliminar

Permanently delete one recorded visitor session and its stored events, for example for an erasure request. Input: sessionId.

Set dynamic regions
set_dynamic_regions
Puede sobrescribir o eliminar

Replace the dynamic (ignored) regions of one story variant, so visual changes inside those rectangles (clocks, animations, random content) stop counting as diffs in future builds of that repository product. Regions are rectangles in fractions (0 to 1) of the image; pass an empty list to clear them. Inputs: repoId, optional productKey, storyId, theme, device, regions.

Mask all suggested areas in a build
apply_build_mask_suggestions
Puede sobrescribir o eliminar

Add every suggested dynamic region for the screens of one build (areas that kept changing in the same spot across accepted builds), then re-check the affected screens in the background so that churn stops counting as a change. Returns how many areas and screens were masked. Input: buildId.

Dismiss mask suggestion
dismiss_mask_suggestion
Puede sobrescribir o eliminar

Turn down a suggested dynamic region for one story variant, so that suggestion (and overlapping ones) is no longer offered. Existing masks are not changed. Inputs: repoId, optional productKey, storyId, theme, device, and the suggested region rectangle.

Soporte

¿Tienes preguntas sobre DiffDeck, su API o una aplicación de IA conectada? Envíanos un correo electrónico; los usuarios con sesión iniciada también pueden abrir un ticket desde la sección de soporte dentro de la aplicación.