Skip to content

Sandgrouse/adobe-express-dev-skill / skills/adobe-express-cors-and-backend

adobe-express-cors-and-backend

Verified

Diagnose and fix CORS errors between Adobe Express add-on UI and backend APIs across local development, private listing, and public listing stages. Use when browser requests fail with preflight, Access-Control-Allow-Origin, Access-Control-Allow-Headers, or OPTIONS issues; when moving from localhost to hosted add-on URL; when deciding where network calls belong (iframe vs sandbox); or when hardening backend origin policy for production.

Adobe Express CORS and Backend Skill

Use this skill to resolve cross-origin failures quickly and safely while keeping secrets off the client.

Core Rule

Treat CORS as a backend response policy problem, not an add-on UI bug.

  • Browser enforces CORS.
  • Postman and curl can pass even when browser fails.
  • Most fixes happen in server middleware order and response headers.

Fast Workflow

  1. Identify stage: local development, private listing, or public listing.
  2. Confirm request origin and endpoint from browser Network tab.
  3. Ensure network calls run in iframe UI runtime, not document sandbox runtime.
  4. Apply stage-specific backend CORS policy from references/cors-stage-playbook.md.
  5. Validate OPTIONS preflight first, then validate the real request.
  6. Harden policy for production (explicit origins, no leaked secrets).

MCP-First Guidance

Call MCP before changing architecture assumptions or API behavior.

  • Use mcp_adobe-express_get_relevant_documentations for official architecture, runtime, distribution, and security guidance.
  • Use mcp_adobe-express_get_typedefinitions when validating Adobe Express runtime APIs.

Prompt examples:

  • "Use mcp_adobe-express_get_relevant_documentations to verify Adobe Express runtime boundaries for fetch calls."
  • "Use mcp_adobe-express_get_relevant_documentations to confirm private vs public distribution behavior before CORS changes."

If tool-tag syntax is supported by your host:

  • #mcp_adobe-express_get_relevant_documentations Adobe Express runtime context and security for network requests

CORS Debug Sequence

Run this order every time:

  1. Open DevTools Network tab and find the failing request pair.
  2. Inspect OPTIONS request:
    • Must return 2xx.
    • Must include Access-Control-Allow-Origin.
    • Must include allowed methods and allowed headers for the real request.
  3. Inspect actual request (GET/POST/etc.) after preflight.
  4. If preflight is blocked by auth middleware, move CORS middleware earlier.
  5. Re-test after each backend change.

Non-Negotiable Production Rules

  • Do not use wildcard origins for public traffic unless explicitly intended and safe.
  • Keep API keys and secrets on backend only.
  • Use explicit allowlist origins, including your Adobe add-on URL.
  • Confirm backend is deployed over HTTPS for private/public distribution.

Framework Notes

Express examples are in the references file. For non-Express backends, apply the same policy model with framework-specific CORS configuration.

See references/cors-stage-playbook.md for:

  • Stage-specific policy (local, private, public)
  • Express config patterns
  • Preflight failure playbook
  • Credentials and wildcard caveats
  • Framework mapping (FastAPI, Flask, Lambda/API Gateway, Workers)

Skill Handoffs

  • UI request wiring and UX errors: adobe-express-spectrum-ui-ux
  • Document operations after API response: adobe-express-document-manipulation
  • OAuth token flow and storage: adobe-express-oauth-authentication
  • MCP setup and core architecture routing: adobe-express-core
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 197kUpdated Claude CodeCodexVerifiedInstall