[PR #2361] [MERGED] feat(anonymous): Custom anonymous names #4278

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2361
Author: @ping-maxwell
Created: 4/19/2025
Status: Merged
Merged: 5/6/2025
Merged by: @Bekacru

Base: mainHead: feat/anonymous-customization


📝 Commits (5)

📊 Changes

3 files changed (+44 additions, -1 deletions)

View changed files

📝 docs/content/docs/plugins/anonymous.mdx (+1 -0)
📝 packages/better-auth/src/plugins/anonymous/anon.test.ts (+25 -0)
📝 packages/better-auth/src/plugins/anonymous/index.ts (+18 -1)

📄 Description

In some cases, name is unique in the DB, so this allows the dev to configure generating a random name via the plugin config.
If suitable, in the future we can consider customizing name (and maybe image too) straight from the client's signIn method- but it's up for debate.

image
  • Docs
  • Tests

For further context:
https://discord.com/channels/1288403910284935179/1363063581784018974


🔄 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/2361 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 4/19/2025 **Status:** ✅ Merged **Merged:** 5/6/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `feat/anonymous-customization` --- ### 📝 Commits (5) - [`019fef6`](https://github.com/better-auth/better-auth/commit/019fef69a8c0b073837598229dd5709e77515c67) feat(anonymous): Custom name for anonymous users - [`88499d1`](https://github.com/better-auth/better-auth/commit/88499d1ca24732e726a9aeb8c053a24686b64b6b) chore: lint - [`aff7121`](https://github.com/better-auth/better-auth/commit/aff71217acf37a5b87dadb670f8787ee23b54abb) chore: cleanup - [`946cf89`](https://github.com/better-auth/better-auth/commit/946cf89fe4c4e54f69d441ee5e1c52ba47bf730a) update: docs - [`cf0c44a`](https://github.com/better-auth/better-auth/commit/cf0c44acb4e4c25b6f87a97c35a619c4ae896bc1) update: pass `ctx` to `generateName` ### 📊 Changes **3 files changed** (+44 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/anonymous.mdx` (+1 -0) 📝 `packages/better-auth/src/plugins/anonymous/anon.test.ts` (+25 -0) 📝 `packages/better-auth/src/plugins/anonymous/index.ts` (+18 -1) </details> ### 📄 Description In some cases, `name` is unique in the DB, so this allows the dev to configure generating a random name via the plugin config. If suitable, in the future we can consider customizing `name` (and maybe `image` too) straight from the client's `signIn` method- but it's up for debate. <img width="543" alt="image" src="https://github.com/user-attachments/assets/91947313-0ee5-4b5f-a99d-f2fe987c9447" /> - [x] Docs - [x] Tests For further context: https://discord.com/channels/1288403910284935179/1363063581784018974 --- <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 11:40:18 -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#4278