API Reference / IntentProvider

IntentProvider

Mount IntentProvider once near the root of your application. It runs the shared intent engine for IntentLink and useIntentTarget.

Usage

// app/layout.tsx
import { IntentProvider } from "intent-link"

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        <IntentProvider>{children}</IntentProvider>
      </body>
    </html>
  )
}

Notes

  • Use one provider for the application. Do not nest providers.
  • It only needs children; there is nothing else to configure.
  • It already includes its client boundary, so it can be imported by a Next.js server layout.