Usage
NextJS Integration
Learn how to use the Nimiq Web Client in your NextJS application
NextJS Integration
The Nimiq Web Client ships with built-in support for NextJS applications. Here's how to get started:
Installation
Basic Usage
Create a new client component:
Always use the 'use client' directive when working with the Nimiq Web Client in NextJS components.
Configuration Options
You can customize the client configuration:
Best Practices
- Client Components: Always use client components when interacting with the Nimiq Web Client
- Error Handling: Implement proper error handling for network issues
- Cleanup: Remember to remove event listeners in useEffect cleanup functions
- State Management: Consider using React Context for sharing client instances
Example with Context
The Web Client requires a browser environment. Make sure your components using it are properly marked as client components.