Sviluppatori

API di DiffDeck

Automatizza DiffDeck tramite un'API REST o connettilo a qualsiasi client MCP, autenticandoti con una singola chiave API. La documentazione di riferimento REST di seguito copre ogni azione; il server MCP offre i tool elencati nella sezione dei tool MCP.
API REST

Esegui qualsiasi azione con una richiesta POST. Inserisci la tua chiave come token bearer.

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

Punta qualsiasi client del Model Context Protocol all'endpoint sottostante. Offre i tool elencati nella sezione dei tool MCP, limitatamente a quanto consentito dal tuo ruolo.

https://diffdeck.ai/api/mcp
Authorization: Bearer kav_...
Collega il tuo assistente IA

Lascia che il tuo assistente IA lavori in DiffDeck per te

Aggiungi DiffDeck a Claude, ChatGPT o a un altro assistente IA come connettore, e potrai chiedergli di cercare informazioni o effettuare modifiche per te in una normale conversazione. Effettua l'accesso con il tuo account, quindi vedrà solo ciò che ti è permesso vedere.

https://diffdeck.ai/api/mcp

Claude si apre con il connettore precompilato. Per ChatGPT, Le Chat, Cursor e altri, selezionalitramite la freccia per ricevere assistenza passo-passo.

Se il tuo client MCP non riesce ad accedere tramite il browser, utilizza invece una chiave API, esattamente come per l'API REST sopra:

Authorization: Bearer kav_...
Cosa può (e non può) fare il tuo assistente

Il tuo assistente può fare solo ciò che il tuo ruolo in DiffDeck ti consente — nulla di più.

Scegli l'accesso in sola lettura se vuoi che si limiti a cercare informazioni, senza mai modificarle.

Ogni modifica apportata viene registrata nel registro di audit, proprio come una modifica fatta da te.

Puoi disconnetterlo in qualsiasi momento da Impostazioni → App collegate.

Tool MCP

Cosa può fare un'app di IA connessa a DiffDeck. Una connessione di sola lettura ottiene solo il primo gruppo; il tuo ruolo nell'organizzazione determina comunque ciò che ciascun tool può toccare.

Cerca informazioni
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.

Apporta modifiche
Set capture settings
set_repo_capture
Può sovrascrivere o eliminare

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
Può sovrascrivere o eliminare
Agisce al di fuori della tua organizzazione

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
Può sovrascrivere o eliminare
Agisce al di fuori della tua organizzazione

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
Può sovrascrivere o eliminare
Agisce al di fuori della tua organizzazione

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
Può sovrascrivere o eliminare
Agisce al di fuori della tua organizzazione

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
Può sovrascrivere o eliminare
Agisce al di fuori della tua organizzazione

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
Può sovrascrivere o eliminare

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

Rename site
rename_replay_site
Può sovrascrivere o eliminare

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

Update session replay settings
update_session_replay_settings
Può sovrascrivere o eliminare

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
Può sovrascrivere o eliminare

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
Può sovrascrivere o eliminare

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

Set dynamic regions
set_dynamic_regions
Può sovrascrivere o eliminare

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
Può sovrascrivere o eliminare

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
Può sovrascrivere o eliminare

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.

Supporto

Domande su DiffDeck, sulla sua API o su un'app di IA connessa? Scrivici un'email: gli utenti con accesso effettuato possono anche aprire un ticket dal Supporto all'interno dell'app.