Skip to content

Latest commit

 

History

History
114 lines (80 loc) · 2.69 KB

File metadata and controls

114 lines (80 loc) · 2.69 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[1.4.6] - 2026-07-10

Changed

  • Updated SmartCode 2.2 hide element re-insertion logic to prevent anti-flicker.

[1.4.5] - 2026-07-09

Changed

  • Default type to SYNC when SmartCode version is 3.0 and no type prop is passed

[1.4.4] - 2026-06-17

Fixed

  • Fixed SmartCode 3.0 localStorage config merge so stored _vwo_*_config values correctly override component defaults

[1.4.0] - 2025-10-09

Added

  • Optimized performance with faster execution and reduced impact on Core Web Vitals (FCP & LCP) by offloading variation decisioning to VWO's servers.
  • Introducing support for running tests directly through Cloudflare Workers, providing seamless and instant changes.(Coming soon)

[1.3.0] - 2025-04-11

Added

  • Added support for passing attributes as props
<link
  rel="preconnect"
  href="URL"
  {...linkAttributes}
/>

[1.0.0] - 2025-03-03

Added

  • First release of Next.js component for VWO Smart-code

    Usage

    Page Router (Legacy pages/ Directory)

    For applications using the Page Router, add the VWOScript component inside _document.js (or _document.tsx if using TypeScript) to include it in the <head> of your HTML document.

    // pages/_document.js
    import Document, { Html, Head, Main, NextScript } from 'next/document';
    import { VWOScript } from 'vwo-smartcode-nextjs';
    
    class MyDocument extends Document {
      render() {
        return (
          <Html>
            <Head>
              <VWOScript accountId="YOUR_ACCOUNT_ID" />
            </Head>
            <body>
              <Main />
              <NextScript />
            </body>
          </Html>
        );
      }
    }
    
    export default MyDocument;

    App Router (app/ Directory)

    For applications using the App Router, include the VWOScript component in layout.tsx to ensure it loads correctly within the <head> of your HTML document.

    // app/layout.tsx
    import { VWOScript } from 'vwo-smartcode-nextjs';
    
    export default function RootLayout({ children }: { children: React.ReactNode }) {
      return (
        <html lang="en">
          <head>
            <VWOScript accountId="YOUR_ACCOUNT_ID" />
          </head>
          <body>{children}</body>
        </html>
      );
    }

    Using Nonce

    To add a nonce attribute for Content Security Policy:

    <VWOScript
      accountId="YOUR_ACCOUNT_ID"
      scriptAttributes={{
        nonce: 'your-nonce-value',
      }}
    />