Skip to content

Commit

Permalink
remove removed features
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisintech committed Oct 25, 2024
1 parent 141c638 commit 880358b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 491 deletions.
49 changes: 15 additions & 34 deletions docs/integrations/webhooks/debug-your-webhooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,21 @@ Incoming webhook events will never be signed in -- they are coming from a source

The following example shows the recommended Middleware configuration for your webhook routes.

<CodeBlockTabs options={["clerkMiddleware", "authMiddleware"]}>
```tsx {{ filename: 'middleware.tsx' }}
import { clerkMiddleware } from '@clerk/nextjs/server'

// Make sure that the `/api/webhooks/(.*)` route is not protected here
export default clerkMiddleware()

export const config = {
matcher: [
// Skip Next.js internals and all static files, unless found in search params
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
// Always run for API routes
'/(api|trpc)(.*)',
],
}
```

```tsx {{ filename: 'middleware.tsx', mark: [4] }}
import { authMiddleware } from '@clerk/nextjs/server'

export default authMiddleware({
ignoredRoutes: ['/api/webhooks(.*)'],
})

export const config = {
matcher: [
// Skip Next.js internals and all static files, unless found in search params
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
// Always run for API routes
'/(api|trpc)(.*)',
],
}
```
</CodeBlockTabs>
```tsx {{ filename: 'middleware.tsx' }}
import { clerkMiddleware } from '@clerk/nextjs/server'

// Make sure that the `/api/webhooks/(.*)` route is not protected here
export default clerkMiddleware()

export const config = {
matcher: [
// Skip Next.js internals and all static files, unless found in search params
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
// Always run for API routes
'/(api|trpc)(.*)',
],
}
```

## Test the Route Handler or API Route

Expand Down
49 changes: 15 additions & 34 deletions docs/integrations/webhooks/sync-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,40 +71,21 @@ This guide can be adapted to listen for any Clerk event.

The following example shows the recommended Middleware configuration for your webhook routes.

<CodeBlockTabs options={["clerkMiddleware()", "authMiddleware()"]}>
```tsx {{ filename: 'middleware.tsx' }}
import { clerkMiddleware } from '@clerk/nextjs/server'

// Make sure that the `/api/webhooks(.*)` route is not protected here
export default clerkMiddleware()

export const config = {
matcher: [
// Skip Next.js internals and all static files, unless found in search params
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
// Always run for API routes
'/(api|trpc)(.*)',
],
}
```

```tsx {{ filename: 'middleware.tsx', mark: [4] }}
import { authMiddleware } from '@clerk/nextjs/server'

export default authMiddleware({
ignoredRoutes: ['/api/webhooks(.*)'],
})

export const config = {
matcher: [
// Skip Next.js internals and all static files, unless found in search params
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
// Always run for API routes
'/(api|trpc)(.*)',
],
}
```
</CodeBlockTabs>
```tsx {{ filename: 'middleware.tsx' }}
import { clerkMiddleware } from '@clerk/nextjs/server'

// Make sure that the `/api/webhooks(.*)` route is not protected here
export default clerkMiddleware()

export const config = {
matcher: [
// Skip Next.js internals and all static files, unless found in search params
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
// Always run for API routes
'/(api|trpc)(.*)',
],
}
```

### Install `svix`

Expand Down
16 changes: 0 additions & 16 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1733,22 +1733,6 @@
]
]
},
{
"title": "Deprecated",
"items": [
[
{
"title": "`authMiddleware()`",
"wrap": false,
"href": "/docs/references/nextjs/auth-middleware"
},
{
"title": "Use Clerk with Next.js 12 and older",
"href": "/docs/references/nextjs/usage-with-older-versions"
}
]
]
},
{
"title": "Demo Repositories",
"items": [
Expand Down
Loading

0 comments on commit 880358b

Please sign in to comment.