Skip to content

Commit

Permalink
docs: add imports to code samples (#182)
Browse files Browse the repository at this point in the history
Examples were missing imports. This adds them to avoid a trip to the demo source code.
  • Loading branch information
jlengstorf authored Jul 2, 2024
1 parent d40d34d commit 9ca0e3c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/astro-clerk-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export const onRequest = clerkMiddleware();

**Supports chaining with `sequence`**
```ts
import { clerkMiddleware } from "astro-clerk-auth/server";

const greeting = defineMiddleware(async (context, next) => {
console.log("greeting request");
console.log(context.locals.auth());
Expand All @@ -98,6 +100,8 @@ export const onRequest = sequence(

**Advanced use with handler**
```ts
import { clerkMiddleware, createRouteMatcher } from "astro-clerk-auth/server";

const isProtectedPage = createRouteMatcher(['/user(.*)', '/discover(.*)', /^\/organization/])

export const onRequest = clerkMiddleware((auth, context, next) => {
Expand Down

0 comments on commit 9ca0e3c

Please sign in to comment.