LocalStorageGatewaysProvider
The LocalStorageGatewaysProvider
is a gateway provider that caches gateway lists in the browser's localStorage
. This allows gateway data to persist across page reloads and browser sessions, making it ideal for web applications that require fast access to gateway information without repeated network requests. The provider automatically manages cache expiration based on a configurable TTL (time-to-live), ensuring that gateway data remains fresh while minimizing network usage. Use this provider when you want persistent, client-side caching of gateway lists in browser environments.
Note: If you are building a React-based application, consider using
@ar.io/wayfinder-react
for seamless integration with React components, hooks, and context providers. This package is designed to work hand-in-hand with gateway providers likeLocalStorageGatewaysProvider
for optimal developer experience.
Basic Usage
Configuration Options
Related Documentation
- Gateway Providers Overview: Compare all gateway providers
- NetworkGatewaysProvider: Dynamic network discovery
- StaticGatewaysProvider: Static gateway configuration
- Wayfinder Configuration: Main wayfinder setup