@privora/react package.
React Integration
Setup
Using PrivoraProvider
The recommended approach is to use the@privora/react package which provides ready-to-use hooks and components:
Using with Wallet Adapter
Local Recovery Display
Show users their encrypted values using theuseDecryptReveal hook:
Revealing Multiple Fields
For orders with multiple encrypted values, useuseDecryptRevealMultiple:
Error Handling
TypeScript Types
Best Practices
- Use the React package: Prefer
@privora/reactover manual provider implementations - Auto-initialize with wallet: Use
autoInitializeprop with wallet adapter for seamless connection - Store recovery data: Always save
userCiphertextanduserNoncefor later decryption - Handle loading states: Show appropriate UI during encryption/decryption operations
- Validate inputs: Check value ranges before encryption (e.g., 0-255 for u8)
- Secure storage: Consider encrypting recovery data at rest in local storage
Next Steps
React Integration Reference
Complete React SDK documentation
React Hooks API
Detailed hooks API reference