Since DPC handles tracking by observing the DOM it can only run in the browser. This requires DPC to be loaded in a way so that it’s not executed on the server when using a framework capable of Server-side rendering (SSR) like Next.js.Documentation Index
Fetch the complete documentation index at: https://docs.depict.ai/llms.txt
Use this file to discover all available pages before exploring further.
Initializing DPC in your entry point
In Next.js you can make sure code is only executed client-side by checkingtypeof window !== "undefined". Since we are importing DPC as a module we can’t do it the with the normal import { DPC } from "depict-ai/dpc" syntax. Instead, we can use dynamic imports. This is also documented by Next.js.
TypeScript

