# URL-based active organization sync

`clerkMiddleware()` now supports configuration to detect an organization by slug in a request's URL and automatically set that organization as active for the current session. Any client-side logic to handle syncing a session's active organization with the current URL can now be removed!

## Try it today

To start using URL-based active organization syncing, see the [`clerkMiddleware()` documentation](https://clerk.com/docs/references/nextjs/clerk-middleware.md#organization-sync-options).

To learn more about best practices for using organization slugs to manage the active organization, check out the [new guide](https://clerk.com/docs/organizations/org-slugs-in-urls.md).
