Skip to content

Conversation

LauraBeatris
Copy link
Member

@LauraBeatris LauraBeatris commented Oct 1, 2025

Description

Introduces a new field slug_disabled on the update organization settings method for /v1/instance/organization_settings

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

  • New Features
    • Organization settings now include a new boolean flag indicating when organization slugs are disabled. This value is exposed in the settings payload, enabling clients to detect and adjust behavior when slug usage is turned off.
  • Bug Fixes
    • None.
  • Documentation
    • None.
  • Refactor
    • None.
  • Style
    • None.
  • Tests
    • None.
  • Chores
    • None.
  • Revert
    • None.

@LauraBeatris LauraBeatris self-assigned this Oct 1, 2025
Copy link

changeset-bot bot commented Oct 1, 2025

🦋 Changeset detected

Latest commit: 154357e

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

This PR includes changesets to release 11 packages
Name Type
@clerk/backend Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch

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 Oct 1, 2025

Walkthrough

Introduces a new boolean field for organization settings: JSON shape adds slug_disabled, and the OrganizationSettings class adds slugDisabled with mapping in fromJSON. A changeset entry is added for a patch release documenting the new field.

Changes

Cohort / File(s) Summary
Backend organization settings resources
packages/backend/src/api/resources/JSON.ts, packages/backend/src/api/resources/OrganizationSettings.ts
Add new boolean field for organization slugs: JSON interface gains slug_disabled; OrganizationSettings adds slugDisabled and maps data.slug_disabled in fromJSON. No removals or control-flow changes.
Release notes (changeset)
.changeset/famous-papers-build.md
Add changeset for patch release of @clerk/backend, documenting the new slug_disabled field on organization settings.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant API as Backend API
  participant OrgSettings as OrganizationSettings

  Client->>API: GET /organization/settings
  API-->>Client: JSON { ..., slug_disabled: boolean }
  Client->>OrgSettings: OrganizationSettings.fromJSON(data)
  activate OrgSettings
  Note over OrgSettings: Map data.slug_disabled -> slugDisabled
  OrgSettings-->>Client: OrganizationSettings instance
  deactivate OrgSettings
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nudge a flag, a tiny toggle bright,
slug_disabled hops into the light.
From JSON burrows to class we weave,
a tidy path for orgs to leave.
Patch-sized paws, precise and small—
thump-thump! another field for all. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The provided title clearly identifies the primary change by specifying the addition of the slug_disabled field to the OrganizationSettings API, follows the conventional commit style for clarity and scope, and remains concise and focused without extraneous detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch laura/add-slugs-disabled-field-1

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • 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 6ea39ae and 154357e.

📒 Files selected for processing (3)
  • .changeset/famous-papers-build.md (1 hunks)
  • packages/backend/src/api/resources/JSON.ts (1 hunks)
  • packages/backend/src/api/resources/OrganizationSettings.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
.changeset/**

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

Automated releases must use Changesets.

Files:

  • .changeset/famous-papers-build.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/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/OrganizationSettings.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/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/OrganizationSettings.ts
packages/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/OrganizationSettings.ts
packages/**/*.{ts,tsx,d.ts}

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

Packages should export TypeScript types alongside runtime code

Files:

  • packages/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/OrganizationSettings.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/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/OrganizationSettings.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/backend/src/api/resources/JSON.ts
  • packages/backend/src/api/resources/OrganizationSettings.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). (3)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (4)
.changeset/famous-papers-build.md (1)

1-6: LGTM!

The changeset is properly formatted and accurately documents the addition of the slug_disabled field as a patch release.

packages/backend/src/api/resources/JSON.ts (1)

264-264: LGTM!

The slug_disabled field is correctly added to the OrganizationSettingsJSON interface using the appropriate snake_case convention for JSON representations, and the boolean type is consistent with similar configuration fields.

packages/backend/src/api/resources/OrganizationSettings.ts (2)

13-13: LGTM!

The slugDisabled field is correctly added to the constructor with the appropriate readonly modifier and boolean type, following TypeScript camelCase naming conventions.


27-27: LGTM!

The mapping from data.slug_disabled to the slugDisabled parameter correctly transforms the snake_case JSON field to camelCase TypeScript property and maintains the proper parameter order.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

vercel bot commented Oct 1, 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 Oct 1, 2025 10:36pm

@LauraBeatris
Copy link
Member Author

Blocking merging this since we need to release the API changes first.

@LauraBeatris LauraBeatris reopened this Oct 2, 2025
@LauraBeatris LauraBeatris enabled auto-merge (squash) October 2, 2025 15:25
Copy link

pkg-pr-new bot commented Oct 2, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: 154357e

@LauraBeatris LauraBeatris merged commit 04cba7d into main Oct 2, 2025
53 checks passed
@LauraBeatris LauraBeatris deleted the laura/add-slugs-disabled-field-1 branch October 2, 2025 15:31
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.

4 participants