@uniai-fe/util-next
v0.3.0
Published
Next.js Utilities for UNIAI FE Projects
Readme
@uniai-fe/util-next
Next.js server/runtime utility package for UNIAI frontend projects.
Install
pnpm add @uniai-fe/util-nextServer Utilities
import {
authorizedFetch,
setDebugResponseHeaders,
setTokenRequestHeaders,
} from "@uniai-fe/util-next/server";setTokenRequestHeaders()reads the current requestAuthorizationheader and returns fetch-ready headers.authorizedFetch()builds a backend request from explicit URL options and caller-provided headers.setDebugResponseHeaders()creates or guards a response with optional metadata headers.
Metadata headers are disabled by default. Applications should enable them only through their own deployment policy.
Runtime Utilities
import { setViewportDeviceInfo } from "@uniai-fe/util-next/runtime-env";setViewportDeviceInfo()adds device classification headers from a user-agent string.
