Add Intelligems Provider

The IntelligemsNextClientsideAppDirectoryProvider component stores Intelligems data in React Context so hooks and components can access it throughout your app.

Example Configuration (App Router)

Create a client-only provider wrapper (for example, app/intelligems-provider.tsx):

circle-exclamation
"use client";

import { IntelligemsNextClientsideAppDirectoryProvider } from "@intelligems/headless/next-clientside-app-directory";

export function IntelligemsProvider({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <IntelligemsNextClientsideAppDirectoryProvider
      organizationId={process.env.NEXT_PUBLIC_INTELLIGEMS_ORG_ID}
      storefrontApiToken={
        process.env.NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN
      }
      activeCurrencyCode="USD"
      antiFlicker={true}
    >
      {children}
    </IntelligemsNextClientsideAppDirectoryProvider>
  );
}

Then wrap your root layout:

circle-exclamation

Last updated