Next Intl Server Runtime
Pack:
next-intlSource:next-intl/next-intl-server-runtime/SKILL.mdUse this skill when the task is about request-scoped config, server-side API selection, or rendering correctness across server and client boundaries.
i18n/request.ts,getRequestConfig, andrequestLocale- component environment rules for hooks vs awaitable APIs
NextIntlClientProviderinheritance, opt-out, and client wrapperssetRequestLocaleand static rendering- metadata, Server Actions, Route Handlers, sitemap, manifest, and OG images
- error files and testing translated components
Routing cues
Section titled “Routing cues”getRequestConfig,requestLocale,NextIntlClientProvider,setRequestLocale, metadata, Server Actions, Route Handlers, sitemap, manifest, OG images, error files, tests -> use this skill- locale routing, domains, pathnames, locale switchers -> use
next-intl-routing-and-navigation - ICU authoring,
t.rich,useFormatter, message validation -> usenext-intl-messages-and-formatting - plugin flags, augmentation, Crowdin,
useExtracted-> usenext-intl-workflows-and-tooling
Default path
Section titled “Default path”- Read references/environment-api-matrix.md first.
- If the task touches static rendering, error files, or tests, read references/static-rendering-errors-and-tests.md.
- Centralize request-scoped config in
i18n/request.ts. - Choose hook APIs only for non-async components. Choose awaitable server APIs everywhere else.
When to deviate
Section titled “When to deviate”- Pass
localeexplicitly when the server surface does not infer it from the current segment. - Use client wrappers only when client-only provider props like
onErrororgetMessageFallbackare needed. - Move to routing skill when locale negotiation and URL structure dominate the task.
Guardrails
Section titled “Guardrails”- Use hooks like
useTranslationsonly in non-async shared or client components. - Use
next-intl/serverawaitables inasynccomponents, metadata, Server Actions, and Route Handlers. - Await
requestLocaleand handle invalid,undefined, and explicit-override cases deliberately. - Return the resolved
localefromgetRequestConfig(...)explicitly. - Validate incoming locales before using them.
- Call
setRequestLocale(locale)before any next-intl API in every locale page or layout that must stay static. - Pass
localeexplicitly to awaitable APIs in metadata, manifest, sitemap, OG-image, and other non-component server surfaces when the locale is not inferred from the segment. NextIntlClientProviderinheritslocale,messages,formats,timeZone, andnow. Usemessages={null}to opt out, and a client wrapper foronErrororgetMessageFallback.- Provide
NextIntlClientProviderin tests and in client-only error surfaces.
- calling translation hooks inside async components
- assuming
requestLocaleis already valid and defined - forgetting
setRequestLocaleon static locale pages that need it - treating provider inheritance as magical when you actually need explicit client wrappers
Verification checklist
Section titled “Verification checklist”- request config is centralized
- hook vs awaitable API choice matches the component/runtime boundary
- incoming locale handling is explicit
- static rendering uses
setRequestLocalewhen required - tests and client-only error surfaces receive provider context
Canonical APIs
Section titled “Canonical APIs”requestLocalegetRequestConfigNextIntlClientProvidersetRequestLocalegetTranslationsgetFormattergetLocalegetMessagesgetNowgetTimeZone
Maintenance
Section titled “Maintenance”- Snapshot date: 2026-03-10
- Package snapshot:
next-intl@4.8.3published 2026-02-16