Svelte 5 support #1242

Open
opened 2026-03-13 08:29:43 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @based64-eth on GitHub (May 21, 2025).

Is this suited for github?

  • Yes, this is suited for github

Wen runes?

Describe the solution you'd like

Support Svelte 5 Runes mode in authClient.

Describe alternatives you've considered

I tried this and it works but it loses the typings.

import { authClient } from '$lib/auth-client';

export class AuthStore {
	public data = $state();
	public error = $state();
	public isPending = $state();
	public isRefetching = $state();

	constructor() {
		$effect.root(() => {
			$effect(() => {
				const sessionStore = authClient.useSession();
				sessionStore.subscribe((session) => {
					this.data = session.data;
					this.error = session.error;
					this.isPending = session.isPending;
					this.isRefetching = session.isRefetching;
				});
				return () => {
					sessionStore.off();
				};
			});
		});
	}
}

export const auth = new AuthStore();

Additional context

No response

Originally created by @based64-eth on GitHub (May 21, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. Wen runes? ### Describe the solution you'd like Support Svelte 5 Runes mode in authClient. ### Describe alternatives you've considered I tried this and it works but it loses the typings. ``` import { authClient } from '$lib/auth-client'; export class AuthStore { public data = $state(); public error = $state(); public isPending = $state(); public isRefetching = $state(); constructor() { $effect.root(() => { $effect(() => { const sessionStore = authClient.useSession(); sessionStore.subscribe((session) => { this.data = session.data; this.error = session.error; this.isPending = session.isPending; this.isRefetching = session.isRefetching; }); return () => { sessionStore.off(); }; }); }); } } export const auth = new AuthStore(); ``` ### Additional context _No response_
Author
Owner

@dosubot[bot] commented on GitHub (Aug 28, 2025):

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

Issue Summary:

  • You requested official support for Svelte 5 Runes mode in authClient to preserve typings.
  • Your current workaround results in lost type information.
  • A maintainer suggested submitting a pull request to address the issue.
  • There was some negative feedback on the proposed solution from another user.
  • No further updates or solutions have been provided since then.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here.
  • If I don’t hear from you within 7 days, this issue will be automatically closed.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 28, 2025): Hi, @based64-eth. 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 requested official support for Svelte 5 Runes mode in authClient to preserve typings. - Your current workaround results in lost type information. - A maintainer suggested submitting a pull request to address the issue. - There was some negative feedback on the proposed solution from another user. - No further updates or solutions have been provided since then. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here. - If I don’t hear from you within 7 days, this issue will be automatically closed. Thanks for your understanding and contribution!
Author
Owner

@mmailaender commented on GitHub (Aug 28, 2025):

This issue is still relevant

@mmailaender commented on GitHub (Aug 28, 2025): This issue is still relevant
Author
Owner

@dosubot[bot] commented on GitHub (Nov 27, 2025):

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

Issue Summary:

  • You requested official support for Svelte 5 Runes mode in authClient to preserve typings.
  • Your current workaround results in loss of type information.
  • A maintainer suggested submitting a pull request, but the proposed solution received negative feedback.
  • No further updates or progress have been made on this issue.
  • Other users have confirmed the issue is still relevant.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting below.
  • If I do not hear back within 7 days, this issue will be automatically closed.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Nov 27, 2025): Hi, @based64-eth. 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 requested official support for Svelte 5 Runes mode in authClient to preserve typings. - Your current workaround results in loss of type information. - A maintainer suggested submitting a pull request, but the proposed solution received negative feedback. - No further updates or progress have been made on this issue. - Other users have confirmed the issue is still relevant. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting below. - If I do not hear back within 7 days, this issue will be automatically closed. Thanks for your understanding and contribution!
Author
Owner

@mmailaender commented on GitHub (Nov 27, 2025):

This issue is still relevant 👍

@mmailaender commented on GitHub (Nov 27, 2025): This issue is still relevant 👍
Author
Owner

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

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

Issue Summary

  • You requested official support for Svelte 5 Runes mode in authClient to preserve typings.
  • Your current workaround results in loss of type information.
  • The issue has been marked as stale twice with summaries provided.
  • Another user confirmed the issue remains relevant.
  • No further progress or solutions have been provided so far.

Next Steps

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting below.
  • If I don’t hear back within 7 days, this issue will be automatically closed.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Feb 26, 2026): Hi, @based64-eth. 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 requested official support for Svelte 5 Runes mode in authClient to preserve typings. - Your current workaround results in loss of type information. - The issue has been marked as stale twice with summaries provided. - Another user confirmed the issue remains relevant. - No further progress or solutions have been provided so far. **Next Steps** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting below. - If I don’t hear back within 7 days, this issue will be automatically closed. Thanks for your understanding and contribution!
Author
Owner

@justinforlenza commented on GitHub (Feb 27, 2026):

This is still relevant

@justinforlenza commented on GitHub (Feb 27, 2026): This is still relevant
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1242