releases.shpreview

createRouteMatcher deprecated; move checks to pages/layouts/routes

@clerk/nextjs@7.5.14

1 enhancementThis release1 enhancementImprovements to existing featuresAI-tallied from the release notes
From the original release noteView original ↗

Patch Changes

  • Deprecate createRouteMatcher() in favor of resource-based auth checks. (#8994) by @Ephem

    Middleware-based auth checks rely on path matching, which can diverge from how Next.js routes requests and leave protected resources reachable.

    For a migration guide, see: https://clerk.com/docs/guides/development/upgrading/upgrade-guides/migrate-from-create-route-matcher

    Instead of protecting routes from middleware, move auth checks into each protected page, layout, API route, or Server Function, for example:

    import { auth } from '@clerk/nextjs/server'
    
    export default async function Page() {
      await auth.protect()
    
      return <h1>Dashboard</h1>
    }
  • Updated dependencies [6f97ef5, bab1f29, f2d9e4b, 80afb69]:

    • @clerk/shared@4.25.0
    • @clerk/react@6.12.0
    • @clerk/backend@3.11.1

Fetched July 8, 2026