'use client' import { IntegrationGuide } from '@/components/IntegrationGuide' import { CodeBlock } from '@/components/CodeBlock' import { getIntegration } from '@/lib/integrations' import { notFound } from 'next/navigation' export default function ReactIntegrationPage() { const integration = getIntegration('react') if (!integration) return notFound() return (

For standard React SPAs (Create React App, Vite, etc.), you can simply add the script tag to your index.html.


Method 1: index.html (Recommended)

The simplest way is to add the script tag directly to the <head> of your index.html file.

{` My React App
`}

Method 2: Programmatic Injection

If you need to load the script dynamically (e.g., only in production), you can use a useEffect hook in your main App component.

{`import { useEffect } from 'react' function App() { useEffect(() => { // Only load in production if (process.env.NODE_ENV === 'production') { const script = document.createElement('script') script.defer = true script.setAttribute('data-domain', 'your-site.com') script.src = 'https://pulse.ciphera.net/script.js' document.head.appendChild(script) } }, []) return (

Hello World

) }`}
) }