Configuration
OpenAPI TypeScript Config
Createopenapi-ts.config.ts in your project root:
openapi-ts.config.ts
@hey-api/client-next- Next.js-specific client with App Router supportruntimeConfigPath- Path to client configuration file
Client Configuration
Create a configuration file for the client:src/hey-api.ts
Package Dependencies
package.json
Usage
Client Component
Use'use client' directive for interactive components:
app/page.tsx
Server Component
Server components can directly await API calls:app/pet/[id]/page.tsx
Layout with Interceptors
Configure global interceptors in the root layout:app/layout.tsx