Glean for Salesforce
Glean offers Salesforce widgets that enable users to seamlessly search across all company apps and receive contextual recommendations directly within Salesforce lightning and community pages.
Installation
The widget is pending review in the AppExchange. Once approved, it can be installed from there. In the meantime, it requires to be installed from outside of the AppExchange.
- Open the package link and log into the org where you’d like to install.
- Choose “Install for Admins only,” check the acknowledgement and press install.
Important
You will be prompted to allow the `https://*.glean.com` as part of CSP policy. This is necessary to allow Glean embedded search to function on community sites.
Use Glean with Salesforce Lightning
Glean provides a Salesforce widget that allows users to search across the entire corpus directly from Salesforce Lightning pages.
Use cases:
- Search across company corpus from any Salesforce lightning record / page / home.
- Get contextual recommendations from a Glean search widget on lightning records.
Glean Search
This widget shows a search bar which can be used to search across all your company’s data. It is available on the following pages in the lightning app builder:
- App Page
- Home Page
- Record Page
Collapsed | Autocomplete | Search |
---|---|---|
![]() |
![]() |
![]() |
Glean Recommendations
The widget shows contextual recommendations based on the current page. It also includes a search box which allows the user to search manually similar to the Glean Search widget.
It is available on the following pages in the lightning app builder:
- Record Page
Preview

Adding a Glean widget to a lightning page
- Open a page where you’d like to display the widget, for example a Case or Contact page.
- Choose “Edit page” from the setup menu.
- Drag the Glean Search / Glean Recommendations widget to the location you’d like it to appear on the page.
- Press the Save button and repeat the process for any other applicable pages.
Use Glean with Salesforce Community
Glean widgets can be used to replace the inbuilt search box and results on a Salesforce community cloud site.
Use-case: Setup Glean external search for authenticated and guest users on a community cloud site.


Configuration
An admin can configure the Glean widgets for Salesforce Community as a one-time activity by visiting the Glean app in Salesforce.
- As a System administrator, open the App menu and search for “Glean”.
- Provide the required configuration settings, as per the steps outlined in the page.
Backend URL
This is the URL for your Glean deployment. It will be of the formhttps://<your-glean-external-search-backend>-be.glean.com
WebApp URL
This is the URL for your Glean deployment web. It can be set tohttps://<your-glean-external-search-subdomain>.glean.com
if one exists or https://app.glean.com
Client-auth API token
To obtain this key, an admin with sufficient access can head tohttps://<your-glean-external-search-domain.glean.com>/admin/setup/tokenManagement?tab=auth
to generate a new key. The admin can set an expiration date for the key or rotate the key as needed.Disable lightning web security if it is enabled (Winter ‘23 and onwards)
Lightning security replaces the current Salesforce lightning locker and is enabled by default in new orgs. This currently causes compatibility issues in community widgets. We recommend turning this off and using the existing Salesforce lightning locker security architecture to use the Glean widget.
Access the Session Settings page as a Salesforce administrator:
- Select the gear in the upper-right of the page.
- Select Setup.
- Enter Session Settings in the Quick Find field.
- Select the Session Settings link in the left navigation bar.
- Uncheck the Use Lightning Web Security for Lightning web components box.
- Select Save.
- Empty your browser cache.
Grant access to Guest user profiles
For guest / existing users access must be granted to their profiles for the GleanCommunitySearchController apex class.
Note
This step is only required if guest users can access the community site.
To access the guest user profile:
- Go to your community site builder page
- Click on “Settings” from the left-hand-side panel
- Click on the guest user profile link to access its settings.
- Click on "Enabled Apex class access"
- Move "glean.GleanCommunitySearchController" to "Enabled Apex classes" and click "Save".
(Optional) Grant access to other user profiles
Similar to above, if non-guest users also access the community site, they need to be granted access to the "GleanCommunitySearchController" apex class.
- Go to "Setup" -> "Apex classes"
- Search for "GleanCommunitySearchController"
- Click on "Security"
- In the next page add the corresponding user profile.
Customize a community site to use Glean search widgets
The example below outlines an integration for a help-center community site, but the same steps should apply for other sites as well.
Navigate to Salesforce experience app builder:
- Go to Setup
- Search for “App manager”
- In the App manager, locate your community site -> actions -> “Manage”.
- Select “Builder”. This will open the Salesforce experience app builder for your site.
Add Glean Search Box
- Select “Page structure” from the left menu, and select “Template Hero”
- Change the “Search component” from the menu on the right to “Glean search”.
Note
This can also be added to the compact header search if the theme you are using supports it.
Add Glean Search Results
- Click on the “edit” icon in the menu bar and select “Search”.
- From the page structure menu on the left, remove “Global search results”.
- From the components menu on the left, drag and drop the “Glean search results” component to a panel on the page in the “Content layout” section.
- Include a search input with the search results.
- Select the Glean search results component and enable “Show inline search box”.
(Optional) Customize the search results page to ensure it has full width and no padding / margins:
- Select “Theme settings” from the left menu.
- Disable “Set max page width”.
Note
If you are using a default theme then this setting would apply to all pages, in which case it is better to clone an existing theme layout and apply this setting change to the search page only.
Use Glean Case Deflection
The Glean case deflection widget suggests articles to the user based on their inputs while they fill out a support request.
To integrate the Glean Case Deflection widget:
- Go to the customer support page in the site builder.
- Remove the default Case deflection widget from the page.
- Drag and drop "Glean Case Deflection" from the component menu to the Sidebar next to the Support request form.
Verify
Click on "Preview" and verify your changes before publishing to your site.
Publish
Lastly, click on “Publish” to publish your changes. Note that this will make the changes live on your site.