CORS CLI command reference

Interact with CORS-entries for your project

npx sanity cors --help

Commands

add

USAGE
  $ sanity cors add ORIGIN [-p <id>] [--yes] [--credentials]

ARGUMENTS
  ORIGIN  Origin to allow (e.g., https://example.com)

FLAGS
  -y, --yes          Confirm risky wildcard origins without prompting
      --credentials  Allow credentials (token/cookie) to be sent from this origin

OVERRIDE FLAGS
  -p, --project-id=<id>  Project ID to add CORS origin to (overrides CLI configuration)

DESCRIPTION
  Add a CORS origin to the project

EXAMPLES
  Interactively add a CORS origin

    $ sanity cors add

  Add a localhost origin without credentials

    $ sanity cors add http://localhost:3000 --no-credentials

  Add a production origin with credentials allowed

    $ sanity cors add https://myapp.com --credentials

  Add a CORS origin for a specific project

    $ sanity cors add https://myapp.com --project-id abc123

delete

USAGE
  $ sanity cors delete [ORIGIN] [-p <id>]

ARGUMENTS
  [ORIGIN]  Origin to delete (will prompt if not provided)

OVERRIDE FLAGS
  -p, --project-id=<id>  Project ID to delete CORS origin from (overrides CLI configuration)

DESCRIPTION
  Delete a CORS origin from the project

EXAMPLES
  Interactively select and delete a CORS origin

    $ sanity cors delete

  Delete a specific CORS origin

    $ sanity cors delete https://example.com

  Delete a CORS origin from a specific project

    $ sanity cors delete --project-id abc123

list

USAGE
  $ sanity cors list [-p <id>]

OVERRIDE FLAGS
  -p, --project-id=<id>  Project ID to list CORS origins for (overrides CLI configuration)

DESCRIPTION
  List CORS origins for the project

EXAMPLES
  List CORS origins for the project

    $ sanity cors list

  List CORS origins for a specific project

    $ sanity cors list --project-id abc123

Was this page helpful?

sanity.ioAll Systems Operational© Sanity 2026
Change site theme