[PR #3187] [CLOSED] feat: add support for custom script url in open-api plugin #12943

Closed
opened 2026-04-13 08:40:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3187
Author: @itsyoboieltr
Created: 6/27/2025
Status: Closed

Base: mainHead: feat/custom-api-reference-script-src


📝 Commits (6)

📊 Changes

3 files changed (+34 additions, -35 deletions)

View changed files

.changeset/bright-trains-marry.md (+5 -0)
📝 packages/better-auth/src/plugins/open-api/index.ts (+23 -6)
📝 packages/better-auth/src/plugins/open-api/open-api.test.ts (+6 -29)

📄 Description

Fixes #3186

This PR adds support for customizing the script src used in the OpenAPI reference HTML. This allows users to self-host the API Reference script instead of relying on the default CDN, which is important for restricted or offline environments.

Changes Introduced:

  • Introduced a new apiReferenceScriptSrc option in OpenAPIOptions.
  • Updated getHTML() to accept and apply apiReferenceScriptSrc.
  • Modified the openAPIReference endpoint to respect the apiReferenceScriptSrc value when rendering the HTML.

Tests Added:

  • Added a test to verify that the provided apiReferenceScriptSrc appears in the generated HTML.

This change is fully backward-compatible. If no apiReferenceScriptSrc is specified, it defaults to the original CDN.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/3187 **Author:** [@itsyoboieltr](https://github.com/itsyoboieltr) **Created:** 6/27/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/custom-api-reference-script-src` --- ### 📝 Commits (6) - [`cd451ec`](https://github.com/better-auth/better-auth/commit/cd451ec3569b501459b445d1e8ea2389c343a9ec) feat: custom api reference script src - [`5a06a5e`](https://github.com/better-auth/better-auth/commit/5a06a5e2a146ca4b4785952386d5ab3cd7ded8dc) feat: add test - [`1f5b48e`](https://github.com/better-auth/better-auth/commit/1f5b48eb5344da694da872c118332d688d037659) api ref optional check - [`22510c8`](https://github.com/better-auth/better-auth/commit/22510c825080ea86f7ac5129649d61529921fcd2) changeset - [`51638da`](https://github.com/better-auth/better-auth/commit/51638daf0479de3742c524e348c73186ccfa4731) Merge branch 'main' into feat/custom-api-reference-script-src - [`5e24bc8`](https://github.com/better-auth/better-auth/commit/5e24bc8642abe8798a09af8e9ff8d436c6db54f9) update ### 📊 Changes **3 files changed** (+34 additions, -35 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/bright-trains-marry.md` (+5 -0) 📝 `packages/better-auth/src/plugins/open-api/index.ts` (+23 -6) 📝 `packages/better-auth/src/plugins/open-api/open-api.test.ts` (+6 -29) </details> ### 📄 Description Fixes #3186 This PR adds support for customizing the script src used in the OpenAPI reference HTML. This allows users to self-host the API Reference script instead of relying on the default CDN, which is important for restricted or offline environments. Changes Introduced: - Introduced a new apiReferenceScriptSrc option in OpenAPIOptions. - Updated getHTML() to accept and apply apiReferenceScriptSrc. - Modified the openAPIReference endpoint to respect the apiReferenceScriptSrc value when rendering the HTML. Tests Added: - Added a test to verify that the provided apiReferenceScriptSrc appears in the generated HTML. This change is fully backward-compatible. If no apiReferenceScriptSrc is specified, it defaults to the original CDN. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 08:40:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#12943