[PR #1291] [CLOSED] feat: allow generating ids asynchronously #29336

Closed
opened 2026-04-17 20:41:40 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1291
Author: @arlyon
Created: 1/27/2025
Status: Closed

Base: mainHead: arlyon/async-generate-id


📝 Commits (1)

  • f6fce33 feat: allow generating ids asynchronously

📊 Changes

10 files changed (+46 additions, -34 deletions)

View changed files

📝 packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts (+5 -5)
📝 packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts (+5 -5)
📝 packages/better-auth/src/adapters/memory-adapter/memory-adapter.ts (+6 -6)
📝 packages/better-auth/src/adapters/mongodb-adapter/mongodb-adapter.ts (+17 -5)
📝 packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts (+5 -5)
📝 packages/better-auth/src/init.ts (+3 -3)
📝 packages/better-auth/src/plugins/anonymous/index.ts (+1 -1)
📝 packages/better-auth/src/plugins/jwt/index.ts (+2 -2)
📝 packages/better-auth/src/plugins/passkey/index.ts (+1 -1)
📝 packages/better-auth/src/types/options.ts (+1 -1)

📄 Description

Many crypto APIs allow async access (for the purposes of gathering
entropy etc). This change allows optionally returning a Promise
instead meaning these async APIs are accessible.

For the particular use-case that motivated this change, nextjs + ppr + dynamicIO requires async crypto APIs to work correctly and since I am using KSUID for generating IDs, the sync API is no longer viable.


🔄 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/1291 **Author:** [@arlyon](https://github.com/arlyon) **Created:** 1/27/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `arlyon/async-generate-id` --- ### 📝 Commits (1) - [`f6fce33`](https://github.com/better-auth/better-auth/commit/f6fce334894af395403b9f6b3a791668ba84a03d) feat: allow generating ids asynchronously ### 📊 Changes **10 files changed** (+46 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts` (+5 -5) 📝 `packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts` (+5 -5) 📝 `packages/better-auth/src/adapters/memory-adapter/memory-adapter.ts` (+6 -6) 📝 `packages/better-auth/src/adapters/mongodb-adapter/mongodb-adapter.ts` (+17 -5) 📝 `packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts` (+5 -5) 📝 `packages/better-auth/src/init.ts` (+3 -3) 📝 `packages/better-auth/src/plugins/anonymous/index.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/jwt/index.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/passkey/index.ts` (+1 -1) 📝 `packages/better-auth/src/types/options.ts` (+1 -1) </details> ### 📄 Description Many crypto APIs allow async access (for the purposes of gathering entropy etc). This change allows optionally returning a Promise instead meaning these async APIs are accessible. For the particular use-case that motivated this change, nextjs + ppr + dynamicIO requires async crypto APIs to work correctly and since I am using KSUID for generating IDs, the sync API is no longer viable. --- <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-17 20:41:40 -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#29336