Function: withAnalyticsRewrites()
withAnalyticsRewrites<Defined in: next/index.ts:90 Wrap a Next.js config to add reverse-proxy rewrites forT>(nextConfig,options?):T
@resq-sw/analytics.
Adds two rules to the beforeFiles rewrite array:
/<prefix>/static/:path* → assetsUpstream/static/:path*(PostHog snippet bundle)./<prefix>/:path* → upstream/:path*(everything else: capture, decide,/e/).
skipTrailingSlashRedirect: true, which is required for the
proxy to work reliably across /ingest and /ingest/.
Type Parameters
T
T extends MinimalNextConfig
The user’s full next.config.{js,ts} type.
Parameters
nextConfig
T
options?
AnalyticsRewriteOptions = {}
Returns
T