Skip to content

Healthcheck Next.js API

Functions

createNextHealthRoute

Source
createNextHealthRoute(manager: HealthManager, options: NextHealthRouteOptions) => { GET: (request: Request) => Promise<Response>; HEAD: (request: Request) => Promise<Response>; }

Exported from: @nexload-sdk/healthcheck-next

Public function exported by @nexload-sdk/healthcheck-next.

createNextMetricsRoute

Source
createNextMetricsRoute(manager: HealthManager, options: NextMetricsRouteOptions) => { GET: (request: Request) => Promise<Response>; }

Exported from: @nexload-sdk/healthcheck-next

Public function exported by @nexload-sdk/healthcheck-next.

Interfaces

NextHealthRouteOptions

Source
interface NextHealthRouteOptions {
  scope: HealthScope
  format?: "json" | "summary"
  httpStatus?: HealthHttpStatusPolicy
  includeDetails?: boolean | ((request: Request) => boolean)
  protect?: NextHealthRouteProtection
  headers?: HeadersInit | ((report: HealthReport) => HeadersInit)
  cache?: "no-store"
}

Exported from: @nexload-sdk/healthcheck-next

Public interface exported by @nexload-sdk/healthcheck-next.

NextHealthRouteProtection

Source
interface NextHealthRouteProtection {
  bearerToken?: string
  basicAuth?: {
    username: string
    password: string
  }
  allowCidrs?: readonly string[]
  allowIps?: readonly string[]
  trustProxy?: boolean
  proxyHeader?: "x-forwarded-for" | "x-real-ip" | string
}

Exported from: @nexload-sdk/healthcheck-next

Public interface exported by @nexload-sdk/healthcheck-next.

NextMetricsRouteOptions

Source
interface NextMetricsRouteOptions {
  format: "prometheus" | "openmetrics" | "json"
  scope?: HealthRunScope
  protect?: NextHealthRouteProtection
  prefix?: string
  defaultLabels?: Record<string, string>
}

Exported from: @nexload-sdk/healthcheck-next

Public interface exported by @nexload-sdk/healthcheck-next.

  • createNextHealthRoute(manager, options) returns { GET, HEAD }.
  • createNextMetricsRoute(manager, options) returns { GET, HEAD }.
  • NextHealthRouteOptions requires a health scope and supports format, status policy, details, protection, headers, and no-store cache.
  • NextMetricsRouteOptions requires prometheus, openmetrics, or json format and supports scope, protection, prefix, and default labels.
  • NextHealthRouteProtection supports bearer, Basic, IPv4/CIDR allowlists, and proxy-header configuration.

Source: src/index.ts.