Extend Express Request object using Typescript
You want to create a custom definition, and use a feature in Typescript called Declaration Merging. This is commonly used, e.g. in method-override. Create a file custom.d.ts and make sure to include it in your tsconfig.json‘s files-section if any. The contents can look as follows: declare namespace Express { export interface Request { tenant?: string … Read more