IgMiddlewareHandler

export interface IgMiddlewareConfig {
  settings: IgMiddlewareConfigSettings;
  routes: {
    forceSkipRoutes?: string[];
    getServerSidePropsRoutes?: string[];
    getStaticPropsRoutes?: string[];
  };
}

export interface IgMiddlewareConfigSettings {
  enabled: boolean;
  orgId: string;
  cacheIntervalMinutes?: number;
}

class IgMiddlewareHandler(req: NextRequest, igConfig: IgMiddlewareConfig){
    setContext(res: NextResponse): Promise<NextResponse | undefined>;
}

Routes specified in routes follow the same pattern as the Next.js matcher.

  1. MUST start with /

  2. Can include named parameters: /about/:path matches /about/a and /about/b but not /about/a/c

  3. Can have modifiers on named parameters (starting with :): /about/:path* matches /about/a/b/c because * is zero or more. ? is zero or one and + one or more

  4. Can use regular expression enclosed in parenthesis: /about/(.*) is the same as /about/:path*

Read more details on path-to-regexp documentation.