Better I18NBetter I18N
Server SDK

API Reference

Full API reference for @better-i18n/server

Complete API reference for the Server SDK.


createServerI18n(config)

Factory function that creates a server-side i18n instance. Call this once at module scope — never inside a request handler.

import { createServerI18n } from "@better-i18n/server";

export const i18n = createServerI18n({
  project: "my-org/api",
  defaultLocale: "en",
});

Config Options

OptionTypeDefaultDescription
projectstringRequiredProject identifier in org/project format
defaultLocalestringRequiredFallback locale when detection fails
cdnBaseUrlstring"https://cdn.better-i18n.com"CDN base URL override
fetchTimeoutnumber10000CDN fetch timeout in milliseconds
retryCountnumber1Number of retries on CDN failure
debugbooleanfalseEnable debug logging
logLevel"debug" | "info" | "warn" | "error" | "silent""warn"Log verbosity

Return Value

Returns a ServerI18n instance — see the ServerI18n interface below.


ServerI18n Interface

The instance returned by createServerI18n.


@better-i18n/server/hono


@better-i18n/server/node


Types

On this page