React SDK Reference
Overview
The Prove component is a React component from the @plutoxyz/web-proofs library that simplifies the integration of Web Proofs into your application. It abstracts away the complexities of handling different devices, platforms, and user setups, allowing developers to seamlessly request and receive proofs from users.
There are two primary methods for generating Web Proofs using Pluto, however you only need to choose one. Choose your preferred implementation method below:
iOS App
: Users can generate proofs using the Pluto Attest app available on iOS devices.-
Chrome Extension
: Users on desktop can use the Pluto Chrome extension to generate proofs (Coming soon).
The Prove component intelligently determines the best method to request a proof based on the user’s device, platform, and installed applications/extensions.
- Detecting if the user is on a mobile device or desktop.
- Checking if the Pluto Chrome extension is installed.
- Listening for proof results from both the iOS app and Chrome extension.
- Providing fallback options if a preferred method isn’t available.
Key Features
Feature | Description |
---|---|
Proof Generation Handling | Manages the proof generation process, including loading states, errors, and displaying the proof result. |
Device and Platform Detection | Automatically detects the user’s device type (mobile or desktop) and operating system (iOS or Android). |
Extension Installation Checks | Checks if the Pluto Chrome extension is installed and prompts the user accordingly. |
Preferred Device Mode | Allows developers to specify a preferred device mode for proof generation (ios or chrome_extension ), which can influence the method used. |
Import
Component.tsx
Usage
Component.tsx
Parameters
The URL to the manifest JSON file defining the proof configuration.
Configuration options for the Prove component
Preferred method for generating proofs. Default is 'ios'.
The mode of the prover. Default is 'Origo'.
Enables developer mode for debugging. Default is false.
Enables Chrome extension support. Default is false.
Show proof result in UI. Default is true.
Show errors in UI. Default is true.
Show loading states. Default is true.
Custom styling options for components
Event callbacks for the component
Called when loading state changes
Called when an error occurs
Called when proof is generated successfully
Called before mobile app redirect