[PR #7744] [MERGED] feat(api-key): support additional fields in api key schema #7529

Closed
opened 2026-03-13 13:40:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7744
Author: @thomasmol
Created: 2/1/2026
Status: Merged
Merged: 3/2/2026
Merged by: @himself65

Base: canaryHead: feat/allow-additional-fields-for-api-key-plugin


📝 Commits (10+)

  • ff58fcd init
  • 6fec43d .
  • 4dc257e Update api-key.mdx
  • 437f204 Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin
  • 3302e97 Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin
  • 0364002 Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin
  • 51131f2 Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin
  • b0a1a9a Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin
  • 317e0a2 Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin
  • c2b0eae Revert test

📊 Changes

8 files changed (+276 additions, -8 deletions)

View changed files

📝 docs/content/docs/plugins/api-key/reference.mdx (+19 -2)
📝 packages/api-key/src/api-key.test.ts (+201 -0)
📝 packages/api-key/src/index.ts (+3 -0)
📝 packages/api-key/src/routes/create-api-key.ts (+15 -2)
📝 packages/api-key/src/routes/index.ts (+5 -0)
📝 packages/api-key/src/routes/update-api-key.ts (+16 -2)
📝 packages/api-key/src/schema.ts (+7 -1)
📝 packages/api-key/src/types.ts (+10 -1)

📄 Description

Summary

  • add apikey.additionalFields to api‑key schema options
  • accept/persist extra fields in create/update endpoints
  • document schema extension usage for api keys
  • tested locally in a separate project; works as expected

References


🔄 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/7744 **Author:** [@thomasmol](https://github.com/thomasmol) **Created:** 2/1/2026 **Status:** ✅ Merged **Merged:** 3/2/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `feat/allow-additional-fields-for-api-key-plugin` --- ### 📝 Commits (10+) - [`ff58fcd`](https://github.com/better-auth/better-auth/commit/ff58fcd8edb6e9a3838aead6ffde80f26f3ffb3f) init - [`6fec43d`](https://github.com/better-auth/better-auth/commit/6fec43dc7b1b49442260d91c58d7f79040afea6e) . - [`4dc257e`](https://github.com/better-auth/better-auth/commit/4dc257e73b2a2c30a2b9532c7cbdf263500c7b7d) Update api-key.mdx - [`437f204`](https://github.com/better-auth/better-auth/commit/437f204443893c3d2990f9a6a35a518f81cb18f7) Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin - [`3302e97`](https://github.com/better-auth/better-auth/commit/3302e971a79eb215e24dd43458b5f1f31caf9f99) Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin - [`0364002`](https://github.com/better-auth/better-auth/commit/0364002dbb9502e86a6f75bb27d6529c4c04e526) Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin - [`51131f2`](https://github.com/better-auth/better-auth/commit/51131f290d6c2f16a058379158f8d58d8558e02c) Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin - [`b0a1a9a`](https://github.com/better-auth/better-auth/commit/b0a1a9a714aed16f36e49f192dd633d79e37772e) Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin - [`317e0a2`](https://github.com/better-auth/better-auth/commit/317e0a224a24d4e457894f42194b5366d163ed0a) Merge branch 'canary' into feat/allow-additional-fields-for-api-key-plugin - [`c2b0eae`](https://github.com/better-auth/better-auth/commit/c2b0eae3a728111ee8adcf1b7a76196f3343cab3) Revert test ### 📊 Changes **8 files changed** (+276 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/api-key/reference.mdx` (+19 -2) 📝 `packages/api-key/src/api-key.test.ts` (+201 -0) 📝 `packages/api-key/src/index.ts` (+3 -0) 📝 `packages/api-key/src/routes/create-api-key.ts` (+15 -2) 📝 `packages/api-key/src/routes/index.ts` (+5 -0) 📝 `packages/api-key/src/routes/update-api-key.ts` (+16 -2) 📝 `packages/api-key/src/schema.ts` (+7 -1) 📝 `packages/api-key/src/types.ts` (+10 -1) </details> ### 📄 Description ### Summary - add `apikey.additionalFields` to api‑key schema options - accept/persist extra fields in create/update endpoints - document schema extension usage for api keys - tested locally in a separate project; works as expected ### References - Closes #7724 - Relevant for #2446 --- <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-03-13 13:40:33 -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#7529