From 1b78bb39d144295bc925289b7372dc01e6e99b3d Mon Sep 17 00:00:00 2001 From: Robert Soriano Date: Mon, 28 Oct 2024 10:12:14 -0400 Subject: [PATCH] chore(express): Expose `AuthObject` type helper (#4416) --- .changeset/twelve-frogs-study.md | 5 +++++ packages/express/env.d.ts | 9 +++++++++ packages/express/package.json | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .changeset/twelve-frogs-study.md create mode 100644 packages/express/env.d.ts diff --git a/.changeset/twelve-frogs-study.md b/.changeset/twelve-frogs-study.md new file mode 100644 index 0000000000..4935d9343f --- /dev/null +++ b/.changeset/twelve-frogs-study.md @@ -0,0 +1,5 @@ +--- +"@clerk/express": patch +--- + +Expose `AuthObject` type helper diff --git a/packages/express/env.d.ts b/packages/express/env.d.ts new file mode 100644 index 0000000000..f983f87926 --- /dev/null +++ b/packages/express/env.d.ts @@ -0,0 +1,9 @@ +import type { AuthObject } from '@clerk/backend'; + +declare global { + namespace Express { + interface Request { + auth: AuthObject; + } + } +} diff --git a/packages/express/package.json b/packages/express/package.json index c3a4931c29..b7dfedfb6d 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -33,11 +33,13 @@ "default": "./dist/index.js" } }, + "./env": "./env.d.ts", "./package.json": "./package.json" }, "main": "./dist/index.js", "files": [ - "dist" + "dist", + "env.d.ts" ], "scripts": { "build": "npm run clean && tsup",