Frontend Integration Guide for Beam and Retro
Best practices and guidelines for integrating Beam and Retro protocols into the frontend
Frontend Integration Guide
This guide outlines the best practices for integrating Beam and Retro protocols into our frontend application. Following these guidelines ensures consistency, maintainability, and easier future upgrades.
Key Principles
- Use SDK for data types and fetching
- Thorough testing on testnet and mainnet
- Proper RPC management
- Consistent error handling and logging
Using the SDK
We use the custom SDK: codemelt-retro-api-sdk
Data Types
Always use data types provided by the SDK.
This approach ensures type consistency and reduces refactoring efforts during upgrades.
Data Fetching
Use SDK methods for data fetching whenever possible.
The SDK provides built-in sanity checks and error handling, improving reliability.
RPC Management
All RPC calls must be proxied through next.config.ts
This is crucial for Beam protocol with multiple RPCs.
Never expose RPC API keys in the frontend code.