[GH-ISSUE #5909] activeOrganizationId doesn't show up in session object when organization plugin is used. #27698

Closed
opened 2026-04-17 18:52:02 -05:00 by GiteaMirror · 9 comments
Owner

Originally created by @rohovskoi on GitHub (Nov 11, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/5909

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Add organization plugin to the list of plugins using 1.4.0-beta.19 or latest stable version.
Use auth.api.getSession().
You will see:

{
session: {
            id: string;
            createdAt: Date;
            updatedAt: Date;
            userId: string;
            expiresAt: Date;
            token: string;
            ipAddress?: string | null | undefined;
            userAgent?: string | null | undefined;
        };
        user: {
            id: string;
            createdAt: Date;
            updatedAt: Date;
            email: string;
            emailVerified: boolean;
            name: string;
            image?: string | null | undefined;
        };
}

Current vs. Expected behavior

Current:

{
session: {
            id: string;
            createdAt: Date;
            updatedAt: Date;
            userId: string;
            expiresAt: Date;
            token: string;
            ipAddress?: string | null | undefined;
            userAgent?: string | null | undefined;
        };
        user: {
            id: string;
            createdAt: Date;
            updatedAt: Date;
            email: string;
            emailVerified: boolean;
            name: string;
            image?: string | null | undefined;
        };
}

Expected:

{
session: {
            id: string;
            createdAt: Date;
            updatedAt: Date;
            userId: string;
            expiresAt: Date;
            token: string;
            ipAddress?: string | null | undefined;
            userAgent?: string | null | undefined;
            activeOrganizationId: string | undefined;
        };
        user: {
            id: string;
            createdAt: Date;
            updatedAt: Date;
            email: string;
            emailVerified: boolean;
            name: string;
            image?: string | null | undefined;
        };
}

What version of Better Auth are you using?

1.4.0-beta.19 and 1.3.34.

System info

.

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
  },
  plugins: [
    organization({
            ac: orgAc,
            creatorRole: 'owner',
            roles: {
              owner
            },
            dynamicAccessControl: {
              maximumRolesPerOrganization: 20,
              enabled: true,
            },
  ]
});

Additional context

One can walk around this bug using customSessionPlugin, but then I need to make one more query to my db on every request, which is not ideal.

I also tried fixing it with databaseHooks.session.create but it didn't return the orgId in getSession result type

Originally created by @rohovskoi on GitHub (Nov 11, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/5909 ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce Add organization plugin to the list of plugins using 1.4.0-beta.19 or latest stable version. Use `auth.api.getSession()`. You will see: ```ts { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; } ``` ### Current vs. Expected behavior Current: ```ts { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; } ``` Expected: ```ts { session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; activeOrganizationId: string | undefined; }; user: { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; } ``` ### What version of Better Auth are you using? 1.4.0-beta.19 and 1.3.34. ### System info ```bash . ``` ### 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 }, plugins: [ organization({ ac: orgAc, creatorRole: 'owner', roles: { owner }, dynamicAccessControl: { maximumRolesPerOrganization: 20, enabled: true, }, ] }); ``` ### Additional context One can walk around this bug using `customSessionPlugin`, but then I need to make one more query to my db on every request, which is not ideal. I also tried fixing it with `databaseHooks.session.create` but it didn't return the `orgId` in `getSession` result type
GiteaMirror added the locked label 2026-04-17 18:52:02 -05:00
Author
Owner

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

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

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3518327753 --> @better-auth-agent[bot] commented on GitHub (Nov 11, 2025): (tag @better-auth-agent if you would like an answer from the Agent) <!-- 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

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

Yes, this is suited for GitHub—there are multiple reports and discussions confirming that activeOrganizationId not appearing in the session object when using the organization plugin is a known limitation, especially in 1.3.x and 1.4.x beta. This is due to a combination of TypeScript type inference issues and how plugin fields are merged into the session schema. The organization plugin is designed to extend the session with activeOrganizationId, and tests expect it to be present after activating an organization, but in practice, it often doesn't show up unless you explicitly set it at runtime or ensure your DB schema and plugin config are correct [source][source][source].

Workarounds include using a databaseHooks.session.create.before hook to set activeOrganizationId by querying the user's organization memberships, but this does require an extra DB query per session [source]. Plugin order and how you type your config can also affect whether the field is inferred or present at runtime. There is ongoing work to improve this, but for now, manual intervention is needed if you want activeOrganizationId reliably in the session object [source].

If you want to share your full config or setup, there may be tweaks to minimize the pain, but the core issue is structural and tracked in the repo.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3518350446 --> @dosubot[bot] commented on GitHub (Nov 11, 2025): <!-- Answer --> Yes, this is suited for GitHub—there are multiple reports and discussions confirming that activeOrganizationId not appearing in the session object when using the organization plugin is a known limitation, especially in 1.3.x and 1.4.x beta. This is due to a combination of TypeScript type inference issues and how plugin fields are merged into the session schema. The organization plugin is designed to extend the session with activeOrganizationId, and tests expect it to be present after activating an organization, but in practice, it often doesn't show up unless you explicitly set it at runtime or ensure your DB schema and plugin config are correct [[source](https://github.com/better-auth/better-auth/issues/4222)][[source](https://github.com/better-auth/better-auth/issues/3490)][[source](https://github.com/better-auth/better-auth/blob/f629295f8844e2ad01ba4d6c5d924a2539413377/packages/better-auth/src/plugins/organization/organization.test.ts#L23-L347)]. Workarounds include using a `databaseHooks.session.create.before` hook to set activeOrganizationId by querying the user's organization memberships, but this does require an extra DB query per session [[source](https://github.com/better-auth/better-auth/issues/3233)]. Plugin order and how you type your config can also affect whether the field is inferred or present at runtime. There is ongoing work to improve this, but for now, manual intervention is needed if you want activeOrganizationId reliably in the session object [[source](https://github.com/better-auth/better-auth/issues/5500)]. If you want to share your full config or setup, there may be tweaks to minimize the pain, but the core issue is structural and tracked in the repo. <!-- 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/f19a4ba9-8a0f-4cb6-b4d0-a57b32911394?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/f19a4ba9-8a0f-4cb6-b4d0-a57b32911394?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/f19a4ba9-8a0f-4cb6-b4d0-a57b32911394?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/f19a4ba9-8a0f-4cb6-b4d0-a57b32911394?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f19a4ba9-8a0f-4cb6-b4d0-a57b32911394?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/f19a4ba9-8a0f-4cb6-b4d0-a57b32911394?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f19a4ba9-8a0f-4cb6-b4d0-a57b32911394?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&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/5909)
Author
Owner

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

Hello @rohovskoi,

When I test it locally, the field is included. Could you share a bit more about your setup?

Ah, one thing, are you using a secondaryStorage?


{
  "session": {
    "expiresAt": "2025-11-19T09:21:24.314Z",
    "token": "23JlzHFvcgQKcoLMN9usQ8wQfiNKRsbF",
    "createdAt": "2025-11-12T09:21:24.316Z",
    "updatedAt": "2025-11-12T09:21:24.316Z",
    "ipAddress": "127.0.0.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
    "userId": "wPwrdQkPYQpt23PZDFpLM9d5yZCNItkj",
    "activeOrganizationId": null,
    "id": "yR5rXKlbO1dFyUCThONvc9K5ZnkReQMS"
  },
  "user": {
    "name": " Kim",
    "email": "my@email.com",
    "emailVerified": true,
    "image": "",
    "createdAt": "2025-11-07T07:54:51.412Z",
    "updatedAt": "2025-11-07T07:55:55.830Z",
    "stripeCustomerId": "cus_TNVWZhxFIaIeAh",
    "id": "wPwrdQkPYQpt23PZDFpLM9d5yZCNItkj"
  }
}
<!-- gh-comment-id:3520955039 --> @bytaesu commented on GitHub (Nov 12, 2025): Hello @rohovskoi, When I test it locally, the field is included. Could you share a bit more about your setup? Ah, one thing, are you using a `secondaryStorage`? --- ```json { "session": { "expiresAt": "2025-11-19T09:21:24.314Z", "token": "23JlzHFvcgQKcoLMN9usQ8wQfiNKRsbF", "createdAt": "2025-11-12T09:21:24.316Z", "updatedAt": "2025-11-12T09:21:24.316Z", "ipAddress": "127.0.0.1", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36", "userId": "wPwrdQkPYQpt23PZDFpLM9d5yZCNItkj", "activeOrganizationId": null, "id": "yR5rXKlbO1dFyUCThONvc9K5ZnkReQMS" }, "user": { "name": " Kim", "email": "my@email.com", "emailVerified": true, "image": "", "createdAt": "2025-11-07T07:54:51.412Z", "updatedAt": "2025-11-07T07:55:55.830Z", "stripeCustomerId": "cus_TNVWZhxFIaIeAh", "id": "wPwrdQkPYQpt23PZDFpLM9d5yZCNItkj" } } ```
Author
Owner

@rohovskoi commented on GitHub (Nov 12, 2025):

@bytaesu Hey :)

Are you on 1.4.0-beta.19?
No i dont use secondaryStorage

 betterAuth({
        baseURL: process.env.API_URL!,
        database: drizzleAdapter(db, {
          provider: 'pg',
          schema: {
            session,
            user,
            account,
            verification,
            member,
            organization: organizationTable,
            organizationRole,
            team,
            teamMember,
          },
        }),
        emailAndPassword: {
          enabled: true,
          autoSignIn: true,
        },
        plugins: [
          organization({
            ac: orgAc,
            creatorRole: 'owner',
            roles: {
              owner,
            },
            dynamicAccessControl: {
              maximumRolesPerOrganization: 20,
              enabled: true,
            },
          })
        ],
      });
<!-- gh-comment-id:3521261129 --> @rohovskoi commented on GitHub (Nov 12, 2025): @bytaesu Hey :) Are you on 1.4.0-beta.19? No i dont use secondaryStorage ```ts betterAuth({ baseURL: process.env.API_URL!, database: drizzleAdapter(db, { provider: 'pg', schema: { session, user, account, verification, member, organization: organizationTable, organizationRole, team, teamMember, }, }), emailAndPassword: { enabled: true, autoSignIn: true, }, plugins: [ organization({ ac: orgAc, creatorRole: 'owner', roles: { owner, }, dynamicAccessControl: { maximumRolesPerOrganization: 20, enabled: true, }, }) ], }); ```
Author
Owner

@rohovskoi commented on GitHub (Nov 12, 2025):

Hello @rohovskoi,

When I test it locally, the field is included. Could you share a bit more about your setup?

Ah, one thing, are you using a secondaryStorage?


{
  "session": {
    "expiresAt": "2025-11-19T09:21:24.314Z",
    "token": "23JlzHFvcgQKcoLMN9usQ8wQfiNKRsbF",
    "createdAt": "2025-11-12T09:21:24.316Z",
    "updatedAt": "2025-11-12T09:21:24.316Z",
    "ipAddress": "127.0.0.1",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
    "userId": "wPwrdQkPYQpt23PZDFpLM9d5yZCNItkj",
    "activeOrganizationId": null,
    "id": "yR5rXKlbO1dFyUCThONvc9K5ZnkReQMS"
  },
  "user": {
    "name": " Kim",
    "email": "my@email.com",
    "emailVerified": true,
    "image": "",
    "createdAt": "2025-11-07T07:54:51.412Z",
    "updatedAt": "2025-11-07T07:55:55.830Z",
    "stripeCustomerId": "cus_TNVWZhxFIaIeAh",
    "id": "wPwrdQkPYQpt23PZDFpLM9d5yZCNItkj"
  }
}

Could you please show your config?

<!-- gh-comment-id:3521502189 --> @rohovskoi commented on GitHub (Nov 12, 2025): > Hello @rohovskoi, > > When I test it locally, the field is included. Could you share a bit more about your setup? > > Ah, one thing, are you using a `secondaryStorage`? > > --- > > ```json > { > "session": { > "expiresAt": "2025-11-19T09:21:24.314Z", > "token": "23JlzHFvcgQKcoLMN9usQ8wQfiNKRsbF", > "createdAt": "2025-11-12T09:21:24.316Z", > "updatedAt": "2025-11-12T09:21:24.316Z", > "ipAddress": "127.0.0.1", > "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36", > "userId": "wPwrdQkPYQpt23PZDFpLM9d5yZCNItkj", > "activeOrganizationId": null, > "id": "yR5rXKlbO1dFyUCThONvc9K5ZnkReQMS" > }, > "user": { > "name": " Kim", > "email": "my@email.com", > "emailVerified": true, > "image": "", > "createdAt": "2025-11-07T07:54:51.412Z", > "updatedAt": "2025-11-07T07:55:55.830Z", > "stripeCustomerId": "cus_TNVWZhxFIaIeAh", > "id": "wPwrdQkPYQpt23PZDFpLM9d5yZCNItkj" > } > } > ``` Could you please show your config?
Author
Owner

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

Hello @rohovskoi,

I see 🤔
Mine(v1.4.0-beta.20) is a local test project with minimal setup. Does the issue occur even with this bare setup?


import { stripe } from "@better-auth/stripe";
import { LibsqlDialect } from "@libsql/kysely-libsql";
import { betterAuth } from "better-auth";
import { openAPI, organization } from "better-auth/plugins";
import Stripe from "stripe";
import { reactInvitationEmail } from "./email/invitation";
import { resend } from "./email/resend";
import { reactResetPasswordEmail } from "./email/reset-password";

const stripeClient = new Stripe(process.env.STRIPE_SECRET_KEY!, {
	apiVersion: "2025-09-30.clover", // Latest API version as of Stripe SDK v19
});

export const auth = betterAuth({
	appName: "Testing",
	database: {
		dialect: new LibsqlDialect({
			url: process.env.TURSO_DATABASE_URL!,
			authToken: process.env.TURSO_AUTH_TOKEN!,
		}),
		type: "sqlite",
	},
	emailAndPassword: {
		enabled: true,
		requireEmailVerification: true,
		async sendResetPassword({ user, url }) {
			await resend.emails.send({
				from,
				to: user.email,
				subject: "Reset your password",
				react: reactResetPasswordEmail({
					username: user.email,
					resetLink: url,
				}),
			});
		},
	},
	emailVerification: {
		sendVerificationEmail: async ({ user, url }) => {
			console.log(url);
			await resend.emails.send({
				from,
				to: user.email,
				subject: "Verify your email address",
				text: `Click the link to verify your email: ${url}`,
			});
		},
	},
	plugins: [
		openAPI(),
		stripe({
			subscription: {
				enabled: true,
				plans: [
					{
						name: "pro",
						priceId: "price_1SQpyOIfk4lalecxdPiaEJ0S",
					},
					{
						name: "starter",
						priceId: "price_1SQgGnIfk4lalecxknSKwJ9t",
					},
				],
			},
			stripeClient,
			stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
			createCustomerOnSignUp: true,
		}),
		organization({
            dynamicAccessControl: {
              maximumRolesPerOrganization: 20,
              enabled: true,
            },
			async sendInvitationEmail(data) {
				await resend.emails.send({
					from,
					to: data.email,
					subject: "You've been invited to join an organization",
					react: reactInvitationEmail({
						username: data.email,
						invitedByUsername: data.inviter.user.name,
						invitedByEmail: data.inviter.user.email,
						teamName: data.organization.name,
						inviteLink:
							process.env.NODE_ENV === "development"
								? `http://localhost:3000/accept-invitation/${data.id}`
								: `${
										process.env.BETTER_AUTH_URL ||
										"https://demo.better-auth.com"
									}/accept-invitation/${data.id}`,
					}),
				});
			},
		}),
	],
	socialProviders: {
		github: {
			clientId: process.env.GITHUB_CLIENT_ID || "",
			clientSecret: process.env.GITHUB_CLIENT_SECRET || "",
		},
	},
});
<!-- gh-comment-id:3522246055 --> @bytaesu commented on GitHub (Nov 12, 2025): Hello @rohovskoi, I see 🤔 Mine(**_v1.4.0-beta.20_**) is a local test project with minimal setup. Does the issue occur even with this bare setup? --- ```ts import { stripe } from "@better-auth/stripe"; import { LibsqlDialect } from "@libsql/kysely-libsql"; import { betterAuth } from "better-auth"; import { openAPI, organization } from "better-auth/plugins"; import Stripe from "stripe"; import { reactInvitationEmail } from "./email/invitation"; import { resend } from "./email/resend"; import { reactResetPasswordEmail } from "./email/reset-password"; const stripeClient = new Stripe(process.env.STRIPE_SECRET_KEY!, { apiVersion: "2025-09-30.clover", // Latest API version as of Stripe SDK v19 }); export const auth = betterAuth({ appName: "Testing", database: { dialect: new LibsqlDialect({ url: process.env.TURSO_DATABASE_URL!, authToken: process.env.TURSO_AUTH_TOKEN!, }), type: "sqlite", }, emailAndPassword: { enabled: true, requireEmailVerification: true, async sendResetPassword({ user, url }) { await resend.emails.send({ from, to: user.email, subject: "Reset your password", react: reactResetPasswordEmail({ username: user.email, resetLink: url, }), }); }, }, emailVerification: { sendVerificationEmail: async ({ user, url }) => { console.log(url); await resend.emails.send({ from, to: user.email, subject: "Verify your email address", text: `Click the link to verify your email: ${url}`, }); }, }, plugins: [ openAPI(), stripe({ subscription: { enabled: true, plans: [ { name: "pro", priceId: "price_1SQpyOIfk4lalecxdPiaEJ0S", }, { name: "starter", priceId: "price_1SQgGnIfk4lalecxknSKwJ9t", }, ], }, stripeClient, stripeWebhookSecret: process.env.STRIPE_WEBHOOK_SECRET!, createCustomerOnSignUp: true, }), organization({ dynamicAccessControl: { maximumRolesPerOrganization: 20, enabled: true, }, async sendInvitationEmail(data) { await resend.emails.send({ from, to: data.email, subject: "You've been invited to join an organization", react: reactInvitationEmail({ username: data.email, invitedByUsername: data.inviter.user.name, invitedByEmail: data.inviter.user.email, teamName: data.organization.name, inviteLink: process.env.NODE_ENV === "development" ? `http://localhost:3000/accept-invitation/${data.id}` : `${ process.env.BETTER_AUTH_URL || "https://demo.better-auth.com" }/accept-invitation/${data.id}`, }), }); }, }), ], socialProviders: { github: { clientId: process.env.GITHUB_CLIENT_ID || "", clientSecret: process.env.GITHUB_CLIENT_SECRET || "", }, }, }); ```
Author
Owner

@rohovskoi commented on GitHub (Nov 13, 2025):

@bytaesu i tried implementing most of your config and still got no inferred type..

<!-- gh-comment-id:3524455925 --> @rohovskoi commented on GitHub (Nov 13, 2025): @bytaesu i tried implementing most of your config and still got no inferred type..
Author
Owner

@ping-maxwell commented on GitHub (Nov 16, 2025):

@rohovskoi do you have a public repo I can check out?

Testing locally and it's inferred for me as well.

It could be a versioning issue, node_modules issue, possibly even a tsconfig issue, or anything like that.

<!-- gh-comment-id:3538591314 --> @ping-maxwell commented on GitHub (Nov 16, 2025): @rohovskoi do you have a public repo I can check out? Testing locally and it's inferred for me as well. It could be a versioning issue, node_modules issue, possibly even a tsconfig issue, or anything like that.
Author
Owner

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

Image

@ping-maxwell I mean, when I call the API, its returned with the session as null which is fine. However, in the editor, TS doesn't see it in the session object...

Here is my tsconfig.json

{
	"compilerOptions": {
		"strict": true,
		"esModuleInterop": true,
		"allowSyntheticDefaultImports": true,
		"exactOptionalPropertyTypes": true,
		"moduleDetection": "force",
		"composite": true,
		"declaration": true,
		"declarationMap": true,
		"downlevelIteration": true,
		"resolveJsonModule": true,
		"pretty": true,
		"skipLibCheck": true,
		"emitDecoratorMetadata": true,
		"experimentalDecorators": true,
		"types": [],
		"isolatedModules": true,
		"sourceMap": true,
		"noImplicitReturns": false,
		"noUnusedLocals": true,
		"noUnusedParameters": false,
		"noFallthroughCasesInSwitch": true,
		"noEmitOnError": false,
		"noErrorTruncation": false,
		"allowJs": false,
		"checkJs": false,
		"forceConsistentCasingInFileNames": true,
		"noImplicitAny": true,
		"noImplicitThis": true,
		"noUncheckedIndexedAccess": false,
		"strictNullChecks": true,
		"incremental": true,
		"removeComments": false,
		"baseUrl": ".",
		"lib": ["ES2022", "DOM", "DOM.Iterable"],
	  "module": "ESNext",
    "moduleResolution": "bundler",
    "target": "ES2022",
    "verbatimModuleSyntax": true,
    "rewriteRelativeImportExtensions": true,
    "erasableSyntaxOnly": true,
    "noImplicitOverride": true,
	}
}

<!-- gh-comment-id:3538946920 --> @rohovskoi commented on GitHub (Nov 16, 2025): <img width="523" height="399" alt="Image" src="https://github.com/user-attachments/assets/e2cebda1-013e-46e2-a75b-e1ba2cbc0777" /> @ping-maxwell I mean, when I call the API, its returned with the session as `null` which is fine. However, in the editor, TS doesn't see it in the session object... Here is my tsconfig.json ```json { "compilerOptions": { "strict": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "exactOptionalPropertyTypes": true, "moduleDetection": "force", "composite": true, "declaration": true, "declarationMap": true, "downlevelIteration": true, "resolveJsonModule": true, "pretty": true, "skipLibCheck": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "types": [], "isolatedModules": true, "sourceMap": true, "noImplicitReturns": false, "noUnusedLocals": true, "noUnusedParameters": false, "noFallthroughCasesInSwitch": true, "noEmitOnError": false, "noErrorTruncation": false, "allowJs": false, "checkJs": false, "forceConsistentCasingInFileNames": true, "noImplicitAny": true, "noImplicitThis": true, "noUncheckedIndexedAccess": false, "strictNullChecks": true, "incremental": true, "removeComments": false, "baseUrl": ".", "lib": ["ES2022", "DOM", "DOM.Iterable"], "module": "ESNext", "moduleResolution": "bundler", "target": "ES2022", "verbatimModuleSyntax": true, "rewriteRelativeImportExtensions": true, "erasableSyntaxOnly": true, "noImplicitOverride": true, } } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#27698