From bcc17b96a03be040d96cd0e916b2d8e98ecc8d73 Mon Sep 17 00:00:00 2001 From: Bereket Engida Date: Fri, 4 Apr 2025 15:57:58 +0300 Subject: [PATCH] docs(tanstack): update code block for API route example and fix syntax spacing --- docs/content/docs/integrations/tanstack.mdx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/content/docs/integrations/tanstack.mdx b/docs/content/docs/integrations/tanstack.mdx index 113096771e..ae3fe9e346 100644 --- a/docs/content/docs/integrations/tanstack.mdx +++ b/docs/content/docs/integrations/tanstack.mdx @@ -12,8 +12,8 @@ Before you start, make sure you have a Better Auth instance configured. If you h We need to mount the handler to a TanStack API endpoint. Create a new file: `/app/routes/api/auth/$.ts` -```ts -import { auth } from '@/lib/auth' +```ts title="routes/api/auth/$.ts" +import { auth } from '@/lib/auth' // import your auth instance import { createAPIFileRoute } from '@tanstack/react-start/api' export const APIRoute = createAPIFileRoute('/api/auth/$')({ @@ -24,6 +24,4 @@ export const APIRoute = createAPIFileRoute('/api/auth/$')({ return auth.handler(request) }, }) -``` - -This will allow you to access use the `getSession` method in all of your routes. +``` \ No newline at end of file