[GH-ISSUE #6971] Property multiSession does not exist on type #28009

Closed
opened 2026-04-17 19:20:51 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @RusAnonym on GitHub (Dec 24, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6971

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Create auth-client.ts
  2. Import multiSessionClient plugin
  3. Add multiSessionClient in authClient

Current vs. Expected behavior

Current:

Image

Expected:

Image

What version of Better Auth are you using?

1.4.9

System info

{
  "system": {
    "platform": "linux",
    "arch": "x64",
    "version": "#1 SMP PREEMPT_DYNAMIC Thu, 18 Dec 2025 13:50:32 +0000",
    "release": "6.17.13-1-MANJARO",
    "cpuCount": 16,
    "cpuModel": "AMD Ryzen 7 5800H with Radeon Graphics",
    "totalMemory": "14.97 GB",
    "freeMemory": "9.60 GB"
  },
  "node": {
    "version": "v24.8.0",
    "env": "development"
  },
  "packageManager": {
    "name": "bun",
    "version": "1.3.4"
  },
  "frameworks": null,
  "databases": [],
  "betterAuth": {
    "version": "1.4.9",
    "config": null
  }
}

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

Client

Auth config (if applicable)


Additional context

Everything is fine in version 1.4.8
Most likely related to #6585

Originally created by @RusAnonym on GitHub (Dec 24, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6971 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Create auth-client.ts 2. Import multiSessionClient plugin 3. Add multiSessionClient in authClient ### Current vs. Expected behavior Current: <img width="1127" height="321" alt="Image" src="https://github.com/user-attachments/assets/a23b88e7-8d11-46df-9a2b-b52028dd9aa6" /> Expected: <img width="896" height="476" alt="Image" src="https://github.com/user-attachments/assets/181f5c89-b5e1-47a0-9a99-fc3e620c467d" /> ### What version of Better Auth are you using? 1.4.9 ### System info ```bash { "system": { "platform": "linux", "arch": "x64", "version": "#1 SMP PREEMPT_DYNAMIC Thu, 18 Dec 2025 13:50:32 +0000", "release": "6.17.13-1-MANJARO", "cpuCount": 16, "cpuModel": "AMD Ryzen 7 5800H with Radeon Graphics", "totalMemory": "14.97 GB", "freeMemory": "9.60 GB" }, "node": { "version": "v24.8.0", "env": "development" }, "packageManager": { "name": "bun", "version": "1.3.4" }, "frameworks": null, "databases": [], "betterAuth": { "version": "1.4.9", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript ``` ### Additional context Everything is fine in version 1.4.8 Most likely related to #6585
GiteaMirror added the lockedbug labels 2026-04-17 19:20:51 -05:00
Author
Owner

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

It seems you're encountering an issue where the property multiSession does not exist on the type for Better Auth version 1.4.9. This may be linked to a type inference problem that occurred after upgrading from version 1.4.8, as you mentioned everything was working fine in that earlier version.

Here are next steps you can take for troubleshooting:

  1. Check Plugin Usage: Ensure that your authClient correctly includes the multiSessionClient as part of the plugins array. It should be conditionally added based on your configuration.

    Example:

    const authClient = createAuthClient({
        plugins: [
            ...(PUBLIC_MULTISESSION === 'true' ? [multiSessionClient()] : [])
        ]
    });
    
  2. Type Definitions: Inspect your TypeScript definitions related to the multiSession. A type mismatch or incorrect import could be causing the issue.

  3. Refer to Open Issues: Look closely at open issues related to multiSession since other community members may have faced similar issues. You can follow the discussion for potential fixes or workarounds that others have found useful.

  4. Roll Back to 1.4.8: If the above do not resolve the issue, consider rolling back to version 1.4.8 until a fix is confirmed for the 1.4.9 version.

If you need further assistance, don't hesitate to tag @bekacru or @ping__ for more specific support regarding Better Auth!

Is there anything else you would like to explore or ask about while resolving this issue?

If you need more help, tag @better-auth-agent in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3688564149 --> @better-auth-agent[bot] commented on GitHub (Dec 24, 2025): It seems you're encountering an issue where the property `multiSession` does not exist on the type for Better Auth version 1.4.9. This may be linked to a type inference problem that occurred after upgrading from version 1.4.8, as you mentioned everything was working fine in that earlier version. Here are next steps you can take for troubleshooting: 1. **Check Plugin Usage**: Ensure that your `authClient` correctly includes the `multiSessionClient` as part of the plugins array. It should be conditionally added based on your configuration. Example: ```typescript const authClient = createAuthClient({ plugins: [ ...(PUBLIC_MULTISESSION === 'true' ? [multiSessionClient()] : []) ] }); ``` 2. **Type Definitions**: Inspect your TypeScript definitions related to the `multiSession`. A type mismatch or incorrect import could be causing the issue. 3. **Refer to Open Issues**: Look closely at open issues related to `multiSession` since other community members may have faced similar issues. You can follow the discussion for potential fixes or workarounds that others have found useful. 4. **Roll Back to 1.4.8**: If the above do not resolve the issue, consider rolling back to version 1.4.8 until a fix is confirmed for the 1.4.9 version. If you need further assistance, don't hesitate to tag @bekacru or @ping__ for more specific support regarding Better Auth! Is there anything else you would like to explore or ask about while resolving this issue? _If you need more help, tag @better-auth-agent in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) • [Discord](https://discord.gg/fG2XXEuQX3) • [GitHub](https://github.com/Skyvern-AI/Skyvern) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/fG2XXEuQX3) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/Skyvern-AI/Skyvern)
Author
Owner

@dosubot[bot] commented on GitHub (Dec 24, 2025):

Hi @RusAnonym! I'm Dosu and I’m helping the better-auth team.

This is a breaking change in Better Auth v1.4.9: plugin properties like .multiSession are no longer automatically inferred unless you explicitly type your auth client with the correct plugin types. This was introduced to improve type safety and plugin inference, but it means that code which worked in v1.4.8 will now throw TypeScript errors unless updated.

To fix the error, you need to use the new AuthClient type helper and explicitly specify your plugins. For example:

import { createAuthClient, type AuthClient } from "better-auth/client";
import { multiSessionClient, type MultiSessionClientPlugin } from "better-auth/client/plugins";

export const authClient: AuthClient<{
  plugins: [MultiSessionClientPlugin];
}> = createAuthClient({
  plugins: [multiSessionClient()],
});

Now, authClient.multiSession will be correctly typed and available.

If you can't migrate immediately, you can use a type assertion as a temporary workaround:

const authClient = createAuthClient({ plugins: [multiSessionClient()] }) as any;

But this will lose type safety.

This change is intentional and tracked in #6585. If you want the old behavior, you can temporarily downgrade to v1.4.8, or try the fix in 1.4.10-beta.1 where some typing issues were reverted.

For more details and migration tips, see the discussion here and the PR introducing the change.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

<!-- gh-comment-id:3688569352 --> @dosubot[bot] commented on GitHub (Dec 24, 2025): <!-- Greeting --> Hi @RusAnonym! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> This is a breaking change in Better Auth v1.4.9: plugin properties like .multiSession are no longer automatically inferred unless you explicitly type your auth client with the correct plugin types. This was introduced to improve type safety and plugin inference, but it means that code which worked in v1.4.8 will now throw TypeScript errors unless updated. To fix the error, you need to use the new AuthClient type helper and explicitly specify your plugins. For example: ```ts import { createAuthClient, type AuthClient } from "better-auth/client"; import { multiSessionClient, type MultiSessionClientPlugin } from "better-auth/client/plugins"; export const authClient: AuthClient<{ plugins: [MultiSessionClientPlugin]; }> = createAuthClient({ plugins: [multiSessionClient()], }); ``` Now, `authClient.multiSession` will be correctly typed and available. If you can't migrate immediately, you can use a type assertion as a temporary workaround: ```ts const authClient = createAuthClient({ plugins: [multiSessionClient()] }) as any; ``` But this will lose type safety. This change is intentional and tracked in [#6585](https://github.com/better-auth/better-auth/pull/6585). If you want the old behavior, you can temporarily downgrade to v1.4.8, or try the fix in `1.4.10-beta.1` where some typing issues were reverted. For more details and migration tips, see the [discussion here](https://github.com/better-auth/better-auth/issues/6965) and the [PR introducing the change](https://github.com/better-auth/better-auth/pull/5815). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/e1558c81-e7f2-435f-8428-036be4b7aada?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e1558c81-e7f2-435f-8428-036be4b7aada?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e1558c81-e7f2-435f-8428-036be4b7aada?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e1558c81-e7f2-435f-8428-036be4b7aada?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e1558c81-e7f2-435f-8428-036be4b7aada?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e1558c81-e7f2-435f-8428-036be4b7aada?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e1558c81-e7f2-435f-8428-036be4b7aada?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20is%20a%20breaking%20change%20in%20Better%20Auth%20v1.4.9%3A%20plugin%20properties%20like%20.multiSession%20are%20no%20longer%20automatically%20inferred%20unless%20you%20explicitly%20type%20your%20auth%20client%20with%20the%20correct%20plugin%20types.%20This%20was%20introduced%20to%20improve%20type%20safety%20and%20plugin%20inference%2C%20but%20it%20means%20that%20code%20which%20worked%20in%20v1.4.8%20will%20now%20throw%20TypeScript%20errors%20unless%20updated.%0A%0ATo%20fix%20the%20error%2C%20you%20need%20to%20use%20the%20new%20AuthClient%20type%20helper%20and%20explicitly%20specify%20your%20plugins.%20For%20example%3A%0A%0A%60%60%60ts%0Aimport%20%7B%20createAuthClient%2C%20type%20AuthClient%20%7D%20from%20%22better-auth/client%22%3B%0Aimport%20%7B%20multiSessionClient%2C%20type%20MultiSessionClientPlugin%20%7D%20from%20%22better-auth/client/plugins%22%3B%0A%0Aexport%20const%20authClient%3A%20AuthClient%3C%7B%0A%20%20plugins%3A%20%5BMultiSessionClientPlugin%5D%3B%0A%7D%3E%20%3D%20createAuthClient%28%7B%0A%20%20plugins%3A%20%5BmultiSessionClient%28%29%5D%2C%0A%7D%29%3B%0A%60%60%60%0A%0ANow%2C%20%60authClient.multiSession%60%20will%20be%20correctly%20typed%20and%20available.%0A%0AIf%20you%20can%27t%20migrate%20immediately%2C%20you%20can%20use%20a%20type%20assertion%20as%20a%20temporary%20workaround%3A%0A%0A%60%60%60ts%0Aconst%20authClient%20%3D%20createAuthClient%28%7B%20plugins%3A%20%5BmultiSessionClient%28%29%5D%20%7D%29%20as%20any%3B%0A%60%60%60%0A%0ABut%20this%20will%20lose%20type%20safety.%0A%0AThis%20change%20is%20intentional%20and%20tracked%20in%20%5B%236585%5D%28https%3A//github.com/better-auth/better-auth/pull/6585%29.%20If%20you%20want%20the%20old%20behavior%2C%20you%20can%20temporarily%20downgrade%20to%20v1.4.8%2C%20or%20try%20the%20fix%20in%20%601.4.10-beta.1%60%20where%20some%20typing%20issues%20were%20reverted.%0A%0AFor%20more%20details%20and%20migration%20tips%2C%20see%20the%20%5Bdiscussion%20here%5D%28https%3A//github.com/better-auth/better-auth/issues/6965%29%20and%20the%20%5BPR%20introducing%20the%20change%5D%28https%3A//github.com/better-auth/better-auth/pull/5815%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/6971)
Author
Owner

@RusAnonym commented on GitHub (Dec 24, 2025):

Resolved: https://github.com/better-auth/better-auth/issues/6965#issuecomment-3688218936

<!-- gh-comment-id:3688577437 --> @RusAnonym commented on GitHub (Dec 24, 2025): Resolved: https://github.com/better-auth/better-auth/issues/6965#issuecomment-3688218936
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#28009