Skip to content

Conversation

@juliusmarminge
Copy link
Contributor

This PR exports the authkit instance to allow users to create custom middlewares. This aligns with the Next.js SDK: https://github.com/workos/authkit-nextjs/blob/464ab8e93fd8be03f06e9ac5de3871afe88d1f91/src/index.ts#L9-L10

src/index.ts Outdated
export { authkitMiddleware } from './server/middleware.js';

// Export authkit instance for configurable middleware
export { authkit } from './server/authkit.js';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good but I need to do some testing to make sure it won't cause issues with the client/server barrier. This is something that I've run into a couple times with TanStack Start and it should be fine, but I just want to do some testing first.

rgcottrell added a commit to Esper-Labs/authkit-tanstack-start that referenced this pull request Nov 30, 2025
This PR exports the authkit instance to allow users to create custom middlewares
Copy link
Member

@nicknisi nicknisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @juliusmarminge! I rebased this onto the current branch where the architecture has changed - the sync authkit instance is now an async getAuthkit() function (for lazy initialization).

export { getAuthkit, type AuthService } from './authkit-loader.js';

@nicknisi nicknisi merged commit 960c327 into workos:main Dec 10, 2025
6 checks passed
@nicknisi nicknisi mentioned this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants