Skip to content

Conversation

SarahSoutoul
Copy link
Contributor

@SarahSoutoul SarahSoutoul commented Sep 2, 2025

Description

Linear issue: https://linear.app/clerk/issue/DOCS-10894/document-setactive-nextjshooksuse-sign-in

Adds reference link for setActive method for hooks using it, after customer feedback around lack of documentation for the method.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • Documentation
    • Clarified hook documentation by adding reference links for setActive across relevant authentication hooks; no API or behavior changes.
  • Chores
    • Added a changeset to prepare a release reflecting the documentation updates.

@SarahSoutoul SarahSoutoul self-assigned this Sep 2, 2025
Copy link

changeset-bot bot commented Sep 2, 2025

🦋 Changeset detected

Latest commit: 2624343

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

coderabbitai bot commented Sep 2, 2025

Walkthrough

Adds a new empty changeset file and updates TSDoc comments in packages/types/src/hooks.ts to include a reference link to the Clerk set-active documentation for setActive in UseSignInReturn, UseSignUpReturn, and UseSessionListReturn. No type signatures or runtime logic changed.

Changes

Cohort / File(s) Summary
Release metadata
\.changeset/fine-masks-judge.md
Added a new changeset file containing front-matter delimiters. No content beyond front-matter.
Hooks TSDoc updates
packages/types/src/hooks.ts
Extended TSDoc for setActive in UseSignInReturn, UseSignUpReturn, and UseSessionListReturn to reference the Clerk set-active docs. No type or runtime changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Assessment against linked issues

Objective Addressed Explanation
Document setActive() in nextjs/hooks/use-sign-in (DOCS-10894) TSDoc comments in code now include a reference link to set-active; it's unclear if the public docs page was updated.

I twitch my whiskers at the docs tonight,
A link now shines for setActive’s light.
In hooks I hop, concise and spry,
Tiny notes beneath the sky.
Thump! A quiet change — a rabbit’s sigh. 🐇✨


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8af1e13 and 2624343.

📒 Files selected for processing (1)
  • .changeset/fine-masks-judge.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/fine-masks-judge.md
🪛 LanguageTool
.changeset/fine-masks-judge.md

[grammar] ~1-~1: Hier könnte ein Fehler sein.
Context: --- ---

(QB_NEW_DE)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (26)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (tanstack-react-router, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Static analysis
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ss/DOCS-10894

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

vercel bot commented Sep 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Sep 3, 2025 6:45am

Copy link

pkg-pr-new bot commented Sep 2, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6692

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@6692

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@6692

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@6692

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@6692

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6692

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6692

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@6692

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@6692

@clerk/express

npm i https://pkg.pr.new/@clerk/express@6692

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@6692

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@6692

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@6692

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@6692

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@6692

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@6692

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6692

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@6692

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@6692

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@6692

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6692

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6692

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@6692

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@6692

commit: 2624343

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
.changeset/fine-masks-judge.md (1)

5-5: Make the summary a touch more specific.

Consider naming the affected hooks (UseSignIn/UseSignUp/UseSessionList) to improve the changelog entry.

-Added reference docs link for hooks using setActive
+Added reference doc link for setActive in UseSignIn/UseSignUp/UseSessionList
packages/types/src/hooks.ts (4)

134-136: Good addition; also mirror the doc on the loaded branch.

Replicate the same TSDoc on the setActive: SetActive; branch to ensure consistent IntelliSense across union variants.

   signIn: SignInResource;
-  setActive: SetActive;
+  /**
+   * A function that sets the active session. See the
+   * [reference doc](https://clerk.com/docs/references/javascript/clerk#set-active).
+   */
+  setActive: SetActive;

158-160: Mirror doc on the loaded branch.

   signUp: SignUpResource;
-  setActive: SetActive;
+  /**
+   * A function that sets the active session. See the
+   * [reference doc](https://clerk.com/docs/references/javascript/clerk#set-active).
+   */
+  setActive: SetActive;

211-213: Mirror doc on the loaded branch and keep wording consistent.

Keep “session and/or organization” wording on both branches for clarity.

   sessions: SessionResource[];
-  setActive: SetActive;
+  /**
+   * A function that sets the active session and/or organization. See the
+   * [reference doc](https://clerk.com/docs/references/javascript/clerk#set-active).
+   */
+  setActive: SetActive;

134-136: Optional: prefer @see for generators that surface it.

If your doc tooling supports it, adding @see improves rendered references (keeps the prose shorter).

- * A function that sets the active session. See the [reference doc](https://clerk.com/docs/references/javascript/clerk#set-active).
+ * A function that sets the active session.
+ * @see https://clerk.com/docs/references/javascript/clerk#set-active

Also applies to: 158-160, 211-213

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ea65f20 and 8af1e13.

📒 Files selected for processing (2)
  • .changeset/fine-masks-judge.md (1 hunks)
  • packages/types/src/hooks.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/fine-masks-judge.md
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/types/src/hooks.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/types/src/hooks.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/types/src/hooks.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/types/src/hooks.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/types/src/hooks.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/types/src/hooks.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
.changeset/fine-masks-judge.md (1)

1-5: Confirm semver level for doc-only change.

This is a types/docs-only tweak. Should this be patch instead of minor for @clerk/types per your release policy?

packages/types/src/hooks.ts (1)

134-136: All setActive hook types include the correct #set-active link; no missing occurrences.

Copy link
Member

@wobsoriano wobsoriano left a comment

Choose a reason for hiding this comment

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

Looks good 👍🏼

Copy link
Member

@alexisintech alexisintech left a comment

Choose a reason for hiding this comment

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

lgtm!

@alexisintech alexisintech merged commit 7f61361 into main Sep 3, 2025
39 checks passed
@alexisintech alexisintech deleted the ss/DOCS-10894 branch September 3, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants