Setup Guide
1
Get API credentials
Set up Factr API key and get your Braze API key from app settings.
2
Create a custom attribute schema
In Braze, create custom user attributes for enrichment data.
3
Build enrichment integration
Set up a backend service that calls Factr and updates Braze user profiles.
4
Design campaigns with enrichment
Use Braze segmentation to target campaigns based on enriched attributes.
Code Example
JavaScript / Node.js
// Braze user enrichment
const braze = require('braze-rest-api');
async function enrichBrazeUser(externalId, email) {
// Enrich with Factr
const factrRes = await fetch('https://factr.polsia.app/api/enrich', {
method: 'POST',
body: JSON.stringify({ email, apiKey: process.env.FACTR_API_KEY })
});
const { fact } = await factrRes.json();
// Update Braze user
const brazeRes = await fetch('https://rest.iad-01.braze.com/users/track', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.BRAZE_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
attributes: [{
external_id: externalId,
enriched_fact: fact
}]
})
});
}
Key Benefits
- Hyper-personalized multi-channel campaigns
- Real-time enrichment on user engagement
- Segment users by enriched insights
- Improve retention with contextual messaging