[GH-ISSUE #6008] cannot see impersonate user method on api #19030

Closed
opened 2026-04-15 17:48:31 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @ShashwatPS on GitHub (Nov 15, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6008

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Image

Current vs. Expected behavior

Checked all the methods on api but couldnt find .impersonateUser

What version of Better Auth are you using?

1.3.28

System info

{
  "system": {
    "platform": "darwin",
    "arch": "arm64",
    "version": "Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041",
    "release": "24.6.0",
    "cpuCount": 12,
    "cpuModel": "Apple M4 Pro",
    "totalMemory": "24.00 GB",
    "freeMemory": "0.39 GB"
  },
  "node": {
    "version": "v24.5.0",
    "env": "development"
  },
  "packageManager": {
    "name": "npm",
    "version": "11.6.2"
  },
  "frameworks": null,
  "databases": [
    {
      "name": "drizzle",
      "version": "0.44.5"
    }
  ],
  "betterAuth": {
    "version": "Unknown",
    "config": null
  }
}

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @ShashwatPS on GitHub (Nov 15, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6008 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce <img width="854" height="689" alt="Image" src="https://github.com/user-attachments/assets/5a6ceeea-56b7-4231-af4f-663b0a4928fd" /> ### Current vs. Expected behavior Checked all the methods on api but couldnt find .impersonateUser ### What version of Better Auth are you using? 1.3.28 ### System info ```bash { "system": { "platform": "darwin", "arch": "arm64", "version": "Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041", "release": "24.6.0", "cpuCount": 12, "cpuModel": "Apple M4 Pro", "totalMemory": "24.00 GB", "freeMemory": "0.39 GB" }, "node": { "version": "v24.5.0", "env": "development" }, "packageManager": { "name": "npm", "version": "11.6.2" }, "frameworks": null, "databases": [ { "name": "drizzle", "version": "0.44.5" } ], "betterAuth": { "version": "Unknown", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the lockedenhancement labels 2026-04-15 17:48:32 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 15, 2025):

Hello, thanks for opening an issue! In the current API (v1.3.28) the impersonateUser method isn’t present, which likely indicates that the impersonation functionality is either not implemented as a direct API method or has been deprecated/relocated. I recommend checking the release notes or changelog for any updates regarding user impersonation and verifying if any additional configuration or plugin is required for that functionality. If you need further assistance on this matter, please tag @bekacru and @ping__ so they can help clarify the intended usage.

tag @better-auth-agent if you would like an answer from the Agent

Is there any additional context or specific workflow you’re aiming to achieve with impersonation?

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3536711953 --> @better-auth-agent[bot] commented on GitHub (Nov 15, 2025): Hello, thanks for opening an issue! In the current API (v1.3.28) the impersonateUser method isn’t present, which likely indicates that the impersonation functionality is either not implemented as a direct API method or has been deprecated/relocated. I recommend checking the release notes or changelog for any updates regarding user impersonation and verifying if any additional configuration or plugin is required for that functionality. If you need further assistance on this matter, please tag @bekacru and @ping__ so they can help clarify the intended usage. tag @better-auth-agent if you would like an answer from the Agent Is there any additional context or specific workflow you’re aiming to achieve with impersonation? <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@bytaesu commented on GitHub (Nov 16, 2025):

Hello @ShashwatPS, could you check if the plugin was added?


import { betterAuth } from "better-auth"
import { admin } from "better-auth/plugins"

export const auth = betterAuth({
    // ... other config options
    plugins: [
        admin() 
    ]
})
import { createAuthClient } from "better-auth/client"
import { adminClient } from "better-auth/client/plugins"

export const authClient = createAuthClient({
    plugins: [
        adminClient()
    ]
})
Image Image
<!-- gh-comment-id:3538392456 --> @bytaesu commented on GitHub (Nov 16, 2025): Hello @ShashwatPS, could you check if the plugin was added? --- ```ts import { betterAuth } from "better-auth" import { admin } from "better-auth/plugins" export const auth = betterAuth({ // ... other config options plugins: [ admin() ] }) ``` ```ts import { createAuthClient } from "better-auth/client" import { adminClient } from "better-auth/client/plugins" export const authClient = createAuthClient({ plugins: [ adminClient() ] }) ``` <img width="400" alt="Image" src="https://github.com/user-attachments/assets/06df515b-b986-4aae-b3b4-cee4e3db12a4" /> <img width="400" alt="Image" src="https://github.com/user-attachments/assets/67671527-fa89-4c4b-ba84-1daffffe3c2e" />
Author
Owner

@ShashwatPS commented on GitHub (Nov 17, 2025):

@bytaesu Yes, the plugins are present. I see the admin methods on the client side but not on the server side.

<!-- gh-comment-id:3540333152 --> @ShashwatPS commented on GitHub (Nov 17, 2025): @bytaesu Yes, the plugins are present. I see the admin methods on the client side but not on the server side.
Author
Owner

@dosubot[bot] commented on GitHub (Feb 16, 2026):

Hi, @ShashwatPS. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that the Better Auth API v1.3.28 does not include the .impersonateUser method, affecting backend usage.
  • The maintainer confirmed this method is not part of the current API and suggested reviewing release notes or plugins for impersonation features.
  • A contributor inquired about the presence of the admin plugin and shared example code for server and client usage.
  • You confirmed plugins are installed, noting admin methods are available client-side but missing server-side, indicating a potential gap in server-side impersonation support.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here to keep the discussion open.
  • If I do not hear back within 7 days, I will automatically close this issue.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3909323476 --> @dosubot[bot] commented on GitHub (Feb 16, 2026): Hi, @ShashwatPS. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that the Better Auth API v1.3.28 does not include the `.impersonateUser` method, affecting backend usage. - The maintainer confirmed this method is not part of the current API and suggested reviewing release notes or plugins for impersonation features. - A contributor inquired about the presence of the admin plugin and shared example code for server and client usage. - You confirmed plugins are installed, noting admin methods are available client-side but missing server-side, indicating a potential gap in server-side impersonation support. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here to keep the discussion open. - If I do not hear back within 7 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19030