External Data Integration (infuseData)
TheinfuseData callback allows you to merge external data with entities fetched by Replyke. This is useful when your entities need additional information from external APIs or databases.
How It Works
When you provide aninfuseData function to useEntityList, it:
- Receives the
foreignIdof each entity - Fetches additional data from your external source
- Adds the external data under an
infusionproperty - Returns the combined data in the
infusedEntitiesarray
entities array remains unchanged, containing only Replyke’s data. External data is safely nested under the infusion property to prevent key conflicts.
Usage
Performance
- Data is fetched once per entity and cached
- Failed fetches return
nulland don’t block other entities - The
infuseDatafunction is called automatically when new entities are loaded
Use Cases
Product Inventory
User Profiles
Analytics Data
Error Handling
TheinfuseData function should handle errors gracefully:
Data Structure
External data is safely nested under theinfusion property to prevent conflicts with Replyke’s entity properties:
Accessing Infused Data
Always access external data through theinfusion property:

