Skip to content
Source
Sign inSign up
TanStack/router

docs: fix import path for useSession in authentication.md #5318

Mergedjohnf(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/5318/headmerged by SeanCassiere

Summary by CodeRabbit

  • Documentation
    • Updated React/TanStack Start authentication guide to use server-specific imports for session handling.
    • Clarified server-side context usage and aligned examples to reflect correct SSR patterns.
    • Improved accuracy of import guidance to prevent misuse in client contexts.
    1. Walkthrough

      Documentation updated to reflect importing useSession from TanStack Start’s server-specific entry point. The doc shows replacing imports in utils/session.ts with @tanstack/react-start/server, noting both occurrences.

      Changes

      Cohort / File(s)Summary of changes
      Docs: React Authentication
      docs/start/framework/react/authentication.md
      Updated guidance to import useSession from @tanstack/react-start/server instead of @tanstack/react-start, applied to both shown snippets.

      Estimated code review effort

      🎯 1 (Trivial) | ⏱️ ~2 minutes

      Poem

      I hop through docs with tidy cheer, Switch paths to server, crystal-clear. Two imports tweaked, no extra fuss— Sessions align, no broken bus. Thump-thump! The guide’s now sleek and clever, A rabbit’s nod: ship it—endeavor! 🥕

      Pre-merge checks and finishing touches

      ✅ Passed checks (3 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title Check✅ PassedThe title clearly and concisely summarizes the primary change by indicating that the import path for useSession in the authentication.md document is being fixed, which directly matches the modifications made in the pull request.
      Docstring Coverage✅ PassedNo functions found in the changes. Docstring coverage check skipped.
      ✨ Finishing touches
      🧪 Generate unit tests
      • Create PR with unit tests
      • Post copyable unit tests in a comment

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. Actionable comments posted: 0

      🧹 Nitpick comments (1)
      docs/start/framework/react/authentication.md (1)

      375-388: Consider adding import statement for consistency.

      This second example also uses useSession (line 378) but doesn't show the import statement. For consistency with the first example at line 98 and to help readers, consider adding the import statement at the beginning of this code block as well.

      Add the import at the start of the code block:

       // Use secure session configuration
      +import { useSession } from '@tanstack/react-start/server'
      +
       export function useAppSession() {
         return useSession({
      📜 Review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between af388a89f783b158f5725056192a278dde3155f8 and 30c79d81c3b79efe3148821560127f1dfd83105d.

      📒 Files selected for processing (1)
      • docs/start/framework/react/authentication.md (1 hunks)
      🧰 Additional context used
      📓 Path-based instructions (2)
      docs/**/*.{md,mdx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)

      Files:

      • docs/start/framework/react/authentication.md
      docs/{router,start}/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Place router docs under docs/router/ and start framework docs under docs/start/

      Files:

      • docs/start/framework/react/authentication.md
      🔇 Additional comments (2)
      docs/start/framework/react/authentication.md (2)

      98-98: LGTM! Correct import path for server-side session management.

      The change to import useSession from @tanstack/react-start/server is correct, as this is server-side session functionality that should be imported from the server-specific entry point.


      609-609: Verify internal documentation link format.

      The link /router/latest/docs/framework/react/how-to/README.md#authentication uses an absolute path. According to the coding guidelines, internal docs links should be relative to the docs/ folder (e.g., ./guide/data-loading).

      As per coding guidelines.

      Please verify if this link should be updated to use a relative path format consistent with the other internal links in this file (like ../authentication-overview.md).

    3. SeanCassiere approved these changes

    4. View your CI Pipeline Execution ↗ for commit 30c79d81c3b79efe3148821560127f1dfd83105d

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded<1sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded2sView ↗

      ☁️ Nx Cloud last updated this comment at 2025-10-02 13:45:16 UTC

    5. More templates

      @tanstack/arktype-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5318

      @tanstack/directive-functions-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5318

      @tanstack/eslint-plugin-router

      npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5318

      @tanstack/history

      npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5318

      @tanstack/nitro-v2-vite-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5318

      @tanstack/react-router

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5318

      @tanstack/react-router-devtools

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5318

      @tanstack/react-router-ssr-query

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5318

      @tanstack/react-start

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5318

      @tanstack/react-start-client

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5318

      @tanstack/react-start-server

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5318

      @tanstack/router-cli

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5318

      @tanstack/router-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5318

      @tanstack/router-devtools

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5318

      @tanstack/router-devtools-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5318

      @tanstack/router-generator

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5318

      @tanstack/router-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5318

      @tanstack/router-ssr-query-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5318

      @tanstack/router-utils

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5318

      @tanstack/router-vite-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5318

      @tanstack/server-functions-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5318

      @tanstack/solid-router

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5318

      @tanstack/solid-router-devtools

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5318

      @tanstack/solid-start

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5318

      @tanstack/solid-start-client

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5318

      @tanstack/solid-start-server

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5318

      @tanstack/start-client-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5318

      @tanstack/start-plugin-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5318

      @tanstack/start-server-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5318

      @tanstack/start-static-server-functions

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5318

      @tanstack/start-storage-context

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5318

      @tanstack/valibot-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5318

      @tanstack/virtual-file-routes

      npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5318

      @tanstack/zod-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5318

      commit: 30c79d8

    6. SeanCassiere merged thiscc52bd7

    7. SeanCassiere closed this

Sign in to join this conversation.