Skip to main content

Overview

The ZKScore React SDK provides React hooks and components for building Web3 applications with ZKScore integration. It includes hooks for scores, identities, achievements, and pre-built components for common use cases.
The React SDK automatically handles ZKS ID resolution, so you can use either ZKS IDs (like alice.zks) or wallet addresses in your components. The SDK will resolve them to the appropriate format.

Installation

Install the ZKScore React SDK using npm or yarn:

Quick Start

1. Provider Setup

2. Environment Configuration

3. First Hook Usage

Configuration Options

Provider Configuration

Core Hooks

1. useScore Hook

2. useIdentity Hook

3. useAchievements Hook

4. useScoreHistory Hook

5. useTrustScore Hook

TypeScript Support

1. Type Definitions

2. Custom Hook Types

Error Handling

1. Global Error Boundary

2. Hook-Level Error Handling

Caching and Performance

1. Cache Configuration

2. Cache Management

Real-time Updates

1. Real-time Configuration

2. Real-time Hook Usage

Best Practices

1. Environment Variables

2. Conditional Rendering

3. Error Recovery

Troubleshooting

Common Issues

1. “Provider not found” Error
2. “Invalid API Key” Error
3. “Network Error” Issues

Support

For additional help: