Setting Cookie Key Based on NODE_ENV in TypeScript

Hey folks! Does anyone know how to provide a cookie key here based on an NODE_ENV? Would like to make the value accessible already at the implementation level as Redacted<string>, instead of defining it manually like NODE_ENV === 'prod' ? 'some' : 'some' ...

export class AuthMiddlewareWithEnvs extends HttpApiMiddleware.Tag<AuthMiddlewareWithEnvs>()(
  'AuthMiddlewareWithEnvs',
  {
    failure: Unauthorized,
    provides: Session,
    security: {
      cookie: HttpApiSecurity.apiKey({
        key: '',
        in: 'cookie',
      }),
    },
  },
) {}
Was this page helpful?