Skip to content

Comments

feat(theme): add requestCredentials option for API requests#1300

Merged
sserrata merged 1 commit intomainfrom
feat/request-credentials-option
Feb 2, 2026
Merged

feat(theme): add requestCredentials option for API requests#1300
sserrata merged 1 commit intomainfrom
feat/request-credentials-option

Conversation

@sserrata
Copy link
Member

@sserrata sserrata commented Feb 2, 2026

Add a new requestCredentials configuration option to control cookie and credential behavior in ApiExplorer requests. This is useful when API documentation is hosted on the same domain as the application, where browsers automatically include session cookies.

Options:

  • "omit": Never send cookies
  • "same-origin": Send cookies for same-origin requests (browser default)
  • "include": Always send cookies, even for cross-origin

Usage in docusaurus.config.js:

themeConfig: {
  api: {
    requestCredentials: "omit",
  },
},

Fixes #1296

@sserrata sserrata self-assigned this Feb 2, 2026
@sserrata sserrata added the enhancement New feature or request label Feb 2, 2026
@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Size Change: 0 B

Total Size: 2.17 MB

ℹ️ View Unchanged
Filename Size
demo/.docusaurus/codeTranslations.json 2 B
demo/.docusaurus/docusaurus.config.mjs 14.7 kB
demo/.docusaurus/globalData.json 60.7 kB
demo/.docusaurus/i18n.json 372 B
demo/.docusaurus/registry.js 87.9 kB
demo/.docusaurus/routes.js 83.1 kB
demo/.docusaurus/routesChunkNames.json 34.4 kB
demo/.docusaurus/site-metadata.json 1.51 kB
demo/build/assets/css/styles.********.css 163 kB
demo/build/assets/js/main.********.js 644 kB
demo/build/assets/js/runtime~main.********.js 21 kB
demo/build/index.html 97.6 kB
demo/build/petstore/add-pet/index.html 29.3 kB
demo/build/petstore/create-user/index.html 24 kB
demo/build/petstore/create-users-with-array-input/index.html 24.1 kB
demo/build/petstore/create-users-with-list-input/index.html 24.1 kB
demo/build/petstore/delete-order/index.html 23.8 kB
demo/build/petstore/delete-pet/index.html 24.1 kB
demo/build/petstore/delete-user/index.html 24.3 kB
demo/build/petstore/find-pets-by-status/index.html 24.8 kB
demo/build/petstore/find-pets-by-tags/index.html 25.4 kB
demo/build/petstore/get-inventory/index.html 23.1 kB
demo/build/petstore/get-order-by-id/index.html 24.1 kB
demo/build/petstore/get-pet-by-id/index.html 24.9 kB
demo/build/petstore/get-user-by-name/index.html 24.4 kB
demo/build/petstore/login-user/index.html 24.9 kB
demo/build/petstore/logout-user/index.html 23.7 kB
demo/build/petstore/new-pet/index.html 24.3 kB
demo/build/petstore/pet/index.html 22.5 kB
demo/build/petstore/place-order/index.html 23.3 kB
demo/build/petstore/schemas/apiresponse/index.html 24.6 kB
demo/build/petstore/schemas/cat/index.html 38.8 kB
demo/build/petstore/schemas/category/index.html 25.7 kB
demo/build/petstore/schemas/dog/index.html 39 kB
demo/build/petstore/schemas/honeybee/index.html 39.1 kB
demo/build/petstore/schemas/id/index.html 22.7 kB
demo/build/petstore/schemas/order/index.html 26.8 kB
demo/build/petstore/schemas/pet/index.html 38.6 kB
demo/build/petstore/schemas/tag/index.html 24.1 kB
demo/build/petstore/schemas/user/index.html 46.4 kB
demo/build/petstore/store/index.html 21.5 kB
demo/build/petstore/subscribe-to-the-store-events/index.html 30.2 kB
demo/build/petstore/swagger-petstore-yaml/index.html 30.2 kB
demo/build/petstore/update-pet-with-form/index.html 24.3 kB
demo/build/petstore/update-pet/index.html 24.7 kB
demo/build/petstore/update-user/index.html 24.3 kB
demo/build/petstore/upload-file/index.html 24.1 kB
demo/build/petstore/user/index.html 22.2 kB

compressed-size-action

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Visit the preview URL for this PR (updated for commit b08ca76):

https://docusaurus-openapi-36b86--pr1300-68ircm3r.web.app

(expires Wed, 04 Mar 2026 18:24:42 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bf293780ee827f578864d92193b8c2866acd459f

Add a new `requestCredentials` configuration option to control cookie
and credential behavior in ApiExplorer requests. This is useful when
API documentation is hosted on the same domain as the application,
where browsers automatically include session cookies.

Options:
- "omit": Never send cookies
- "same-origin": Send cookies for same-origin requests (browser default)
- "include": Always send cookies, even for cross-origin

Usage in docusaurus.config.js:
```js
themeConfig: {
  api: {
    requestCredentials: "omit",
  },
},
```

Fixes #1296
@sserrata sserrata force-pushed the feat/request-credentials-option branch from cb169d1 to b08ca76 Compare February 2, 2026 18:20
@sserrata sserrata merged commit 0f643dd into main Feb 2, 2026
6 checks passed
@sserrata sserrata deleted the feat/request-credentials-option branch February 2, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specify credentials: "omit" in ApiExplorer requests

1 participant