Add the Fin Messenger to your Salesforce Experience Cloud (portal) site and control which signed-in user data is sent to Fin entirely through configuration, no Apex editing required.
Note: What changed (Jun 2026): Previously this guide asked you to edit the JwtGenerator Apex class to choose the user identifier and which attributes to send. That isn’t possible in a production org (Salesforce doesn’t allow editing Apex via Setup in production, and packaged classes are overwritten on upgrade). You now configure all of this in Fin Messenger Settings (custom setting), with an optional Apex interface for advanced cases (see Step 6).
Install Fin Messenger on a Salesforce webpage
1. Install the package in Salesforce
To install Fin Messenger on a Salesforce webpage, we've created a package you can install, which simply creates a custom setting definition.
You'll need to install the package in your Salesforce environment, before following the steps below.
Or
2. Configure Fin Messenger settings in Salesforce
The package adds a Fin Messenger Settings custom setting that stores your App ID, JWT secret, and (new) the user-data configuration.
A) Open the settings
Go to Setup > Custom Settings.
Open Fin Messenger Settings.
Click Manage.
Click New (or Edit) on the Default Organization Level Value.
B) App ID — in Fin, Settings > General; enter it in the App Id field.
C) JWT Secret Key — in Fin, Settings > Fin Messenger; enter it in the JWT Secret Key field.
These two are the only required values. The rest (Step 6) are optional.
3. Configure content security policy (CSP)
Setup > Digital Experiences > All Sites > (your site) > Builder > Settings > Security & Privacy.
Set Security Level to Relaxed CSP.
Under Trusted Sites for Scripts, add
https://widget.intercom.ioandhttps://js.intercomcdn.com.Under Setup → Trusted URLs, add the Intercom URLs/CSP directives, with CSP Context = All or Experience Builder Sites.
4. Add the Fin Messenger boot script to your portal
<script>
window.addEventListener('finMessengerData', function (e) {
var data = e.detail || {};
window.intercomSettings = {
api_base: 'https://api-iam.intercom.io', // regional base — see table
app_id: data.appId,
intercom_user_jwt: data.jwt // omitted/null → boots logged-out
};
window.Intercom && window.Intercom('boot', window.intercomSettings);
});
</script>
Region |
|
US |
|
EU |
|
Australia |
|
5. Add the Fin Messenger component to your page
Setup > Digital Experiences > All Sites > (your site) > Builder.
Drag the Fin Messenger component onto the portal page.
Publish the site.
6. Configure the user data sent to Fin
All set on the Fin Messenger Settings record (Step 2) — no code changes. Leave a field blank to keep the default.
Field | What it controls | Default when blank |
User Id Field | The User field whose value becomes the Fin |
|
Attribute Fields | Extra attributes to send (format below). | none |
Company Id Field | The User field sent as | omitted |
Provider Class | Advanced: an Apex class returning custom attributes. | not used |
Attribute Fields format
Comma-separated intercomKey:UserField pairs:
Left of the colon — the Intercom attribute name (key Fin receives).
Right of the colon — the Salesforce User field API name to read the value from.
A bare field name uses the lowercased field name as the Intercom key.
Custom fields use their API name (
__c). Unknown fields are ignored.
Example: phone:Phone, job_title:Title, Department, plan:Account_Tier__c produces:
{ "phone": "(555) 123-4567", "job_title": "Account Executive", "department": "Sales", "plan": "Enterprise" }Note: name, email, and user_id are always sent (don't list them here).
Advanced: custom attributes via Apex
For values you can't express as a single User field, implement FinAttributeProvider in your own Apex class (editable, in your org), then put its name in Provider Class:
global class MyFinAttributes implements finmessenger.FinAttributeProvider {
global Map<String, Object> injectFinCustomAttributes(User currentUser) {
Map<String, Object> attrs = new Map<String, Object>();
attrs.put('locale', currentUser.LanguageLocaleKey);
attrs.put('is_internal',
currentUser.Email != null && currentUser.Email.endsWith('@acme.com'));
// currentUser only has the configured fields — query anything else yourself
Contact c = [
SELECT AccountId, Account.Name, Account.Subscription_Tier__c
FROM Contact WHERE Id = :currentUser.ContactId LIMIT 1
];
attrs.put('plan', c.Account.Subscription_Tier__c);
attrs.put('company', new Map<String, Object>{
'company_id' => c.AccountId, 'name' => c.Account.Name
});
return attrs;
}
}Must be
global(called across the package namespace).currentUseronly contains the fields configured in Step 6 — query anything else.The provider's map is merged last, so its keys win over Attribute Fields.
Keep it lightweight — it runs on every messenger boot (errors are caught; slow queries slow the boot).
FAQs
How do I find my Fin App ID?
Go to Settings > General. Your App ID is listed under the App details section.
Where can I find the JWT Secret Key?
In Settings > Fin Messenger, copy your JWT Secret Key.
What if the messenger doesn’t load?
Check your CSP settings. Ensure both trusted script URLs and trusted URLs are configured correctly and the security level is set to Relaxed CSP.
Can I restrict which user data is sent to Fin?
Yes, that’s Step 6. Configure User Id Field, Attribute Fields, Company Id Field, and Provider Class in Fin Messenger Settings. Only name, email, user_id, and whatever you list in Attribute Fields is sent. Clear fields to send less.
Do I need to edit Apex?
No, the standard configuration in Step 6 requires no code changes. Apex is only needed if you opt into the advanced Provider Class hook, which uses a class you write in your own org (not the packaged Apex).
How do I resolve Apex compile failures?
The Salesforce package relies on standard objects and fields so if there's a compile failure it could be due to orphaned Apex classes in the Salesforce organization.
In such scenarios click on the Advanced Options accordion during installation.
Select Compile only the Apex in the package and then hit Install.
Need more help? Get support from our Community Forum
Find answers and get help from Intercom Support and Community Experts



