// app/layout.tsx
'use client'
import { useEffect } from 'react'
import { init } from '@toffee/sdk'
export default function RootLayout({ children }: { children: React.ReactNode }) {
useEffect(() => {
const toffee = init({
apiKey: 'YOUR_API_KEY',
endpoint: 'https://api.toffee.at',
})
return () => toffee.destroy()
}, [])
return (
<html>
<body>{children}</body>
</html>
)
}