Skip to main content
The Hey Chocolate Next.js integration provides server components, client hooks, and edge-optimized data fetching.

Installation

Setup

Add the provider to your root layout:

Server Components

Fetch sustainability data on the server for optimal performance:

Client Hooks

Use hooks for interactive features:

Edge caching

Product impact data is automatically cached at the edge with a 1-hour TTL:

Components

All React SDK components are available:

Environment variables

Use HEYCHOCOLATE_API_KEY for server-side requests and NEXT_PUBLIC_HEYCHOCOLATE_API_KEY (read-only) for client components.