Skip to content

Commit

Permalink
chore: infer clerkAuth type instead of importing it directly
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsterDeveloper committed Apr 21, 2024
1 parent 14c704a commit c467cf4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/clerk-auth/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { type ClerkClient, type ClerkOptions, createClerkClient } from '@clerk/backend'
import type { RequestState } from '@clerk/backend/dist/tokens/authStatus'
import { PROD_API_URL } from '@clerk/shared'
import type { Context, MiddlewareHandler } from 'hono'
import { env } from 'hono/adapter'

type ClerkAuth = ReturnType<Awaited<ReturnType<ClerkClient['authenticateRequest']>>['toAuth']>

declare module 'hono' {
interface ContextVariableMap {
clerk: ClerkClient
clerkAuth: ReturnType<RequestState['toAuth']>
clerkAuth: ClerkAuth
}
}

Expand Down

0 comments on commit c467cf4

Please sign in to comment.