JS (Fullstack) Example
This guide demonstrates how to integrate the Reclaim Protocol JavaScript SDK into a fullstack application. We'll cover both the backend and frontend implementations.
Video Walkthrough
Backend Implementation
For a detailed backend implementation using Node.js and Express, please refer to the Backend Example.
The backend example provides a comprehensive guide on setting up a server that generates the SDK configuration and handles proof verification.
Frontend Implementation
This section demonstrates how to integrate the Reclaim SDK into your frontend application using the configuration received from your backend server.
Prerequisites
- A running backend server with Reclaim SDK configuration endpoints
- Node.js environment with npm/yarn
- Basic understanding of async/await and Promise handling
Basic Implementation
Here's a step-by-step implementation showing how to initialize and use the Reclaim SDK:
For detailed information about the proof object structure, see the Advanced Configuration documentation.
This implementation provides a streamlined approach to integrating Reclaim SDK. It handles both success and error cases while maintaining a clean, user-friendly interface.
Implementation Guide
-
Backend Setup
- Complete the backend setup as outlined in the Backend Example
- Ensure your endpoints are properly secured and tested
-
Frontend Integration
- Install the Reclaim SDK package
- Implement the frontend code in your application
- Configure proper error handling and user feedback
-
Configuration
- Replace 'https://your-backend.com/reclaim/generate-config' with your actual backend endpoint
- Customize the success and error handlers according to your application needs
Ensure your backend endpoint is properly secured and accessible from your frontend application's domain.
Best Practices and Recommendations
-
User Experience
- Implement loading states during verification
- Provide clear feedback throughout the process
- Add proper error messages for different failure scenarios
-
Security Considerations
- Implement proper authentication mechanisms
- Validate all incoming data
- Use secure communication channels (HTTPS)
-
Testing
- Test with different network conditions
- Verify error handling scenarios
- Ensure cross-browser compatibility
-
Maintenance
- Keep the SDK updated to the latest version
- Monitor for any deprecation notices
- Maintain proper logging for debugging
This implementation provides a solid foundation for integrating the Reclaim Protocol into your application. For additional features and customization options, refer to our advanced documentation sections.