Author:
    Creation:2026-07-08Last update:2026-07-08

    Live sync

    Live Sync allows your app to reflect CMS content changes at runtime. No rebuild or redeploy is required. When enabled, updates are streamed to a Live Sync server that refreshes the dictionaries your application reads.

    Table of contents


    Enabling Live Sync

    Live Sync requires a continuous server connection and is available on the enterprise plan.

    Enable Live Sync by updating your Intlayer configuration:

    intlayer.config.ts
    import type { IntlayerConfig } from "intlayer";
    
    const config: IntlayerConfig = {
      // ... other configuration settings
      editor: {
        /**
         * Enables hot reloading of locale configurations when changes are detected.
         * For example, when a dictionary is added or updated, the application updates
         * the content displayed on the page.
         *
         * Because hot reloading requires a continuous connection to the server, it is
         * only available for clients of the `enterprise` plan.
         *
         * Default: false
         */
        liveSync: true,
      },
      dictionary: {
        /**
         * Controls how dictionaries are imported:
         *
         * - "fetch": Dictionaries are fetched dynamically using the Live Sync API.
         *   Replaces useIntlayer with useDictionaryDynamic.
         *
         * Note: Live mode uses the Live Sync API to fetch dictionaries. If the API call
         * fails, dictionaries are imported dynamically.
         * Note: Only dictionaries with remote content and "live" flags use live mode.
         * Others use dynamic mode for performance.
         */
        importMode: "fetch",
      },
    };
    
    export default config;

    Start the Live Sync server to wrap your application:

    Example using Next.js:

    package.json
    {  "scripts": {    // ... other scripts    "build": "next build",    "dev": "next dev",    "start": "npx intlayer live --with 'next start'",  },}

    Example using Vite:

    package.json
    {  "scripts": {    // ... other scripts    "build": "vite build",    "dev": "vite dev",    "start": "npx intlayer live --with 'vite start'",  },}

    The Live Sync server wraps your application and automatically applies updated content as it arrives.

    To receive change notifications from the CMS, the Live Sync server maintains an SSE connection to the backend. When content changes in the CMS, the backend forwards the update to the Live Sync server, which writes the new dictionaries. Your application will reflect the update on the next navigation or browser reload, no rebuild required.

    Flow chart (CMS/Backend -> Live Sync Server -> Application Server -> Frontend):

    Live Sync Logic Schema

    How it works:

    Live Sync Flow CMS/Backend/Live Sync Server/Application Server/Frontend Schema

    Development workflow (local)

    • In development, all remote dictionaries are fetched when the application starts, so you can test updates quickly.
    • To test Live Sync locally with Next.js, wrap your dev server:
    package.json
    {  "scripts": {    // ... other scripts    "dev": "npx intlayer live --with 'next dev'",    // "dev": "npx intlayer live --with 'vite dev'", // For Vite  },}

    Enable optimisation so Intlayer applies the Live import transformations during development:

    intlayer.config.ts
    import type { IntlayerConfig } from "intlayer";
    
    const config: IntlayerConfig = {
      editor: {
        applicationURL: "http://localhost:5173",
        liveSyncURL: "http://localhost:4000",
        liveSync: true,
      },
      dictionary: {
        importMode: "fetch",
      },
      build: {
        optimize: true,
      },
    };
    
    export default config;

    This setup wraps your dev server with the Live Sync server, fetches remote dictionaries at startup, and streams updates from the CMS via SSE. Refresh the page to see changes.

    Notes and constraints

    • Add the live sync origin to your site security policy (CSP). Ensure the live sync URL is allowed in connect-src (and frame-ancestors if relevant).
    • Live Sync does not work with static output. For Next.js, the page must be dynamic to receive updates at runtime (e.g., use generateStaticParams, generateMetadata, getServerSideProps, or getStaticProps appropriately to avoid full static-only constraints).
    • In the CMS, each dictionary has a live flag. Only dictionaries with live=true are fetched via the live sync API; others are imported dynamically and remain unchanged at runtime.
    • The live flag is evaluated for each dictionary at build time. If remote content was not flagged live=true during build, you must rebuild to enable Live Sync for that dictionary.
    • The live sync server must be able to write to .intlayer. In containers, ensure write access to /.intlayer.