'use client' import Link from 'next/link' import { ArrowLeftIcon } from '@ciphera-net/ui' export default function ReactIntegrationPage() { return (
For standard React SPAs (Create React App, Vite, etc.), you can simply add the script tag to your index.html.
The simplest way is to add the script tag directly to the <head> of your index.html file.
{`
My React App
`}
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
)
}`}