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.


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.

  1. Open the package link and log into the org where you’d like to install.
  2. Choose “Install for Admins only,” check the acknowledgement and press install. Installation Page

You will be prompted to allow the `https://*` 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
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



Adding a Glean widget to a lightning page

  1. Open a page where you’d like to display the widget, for example a Case or Contact page.
  2. Choose “Edit page” from the setup menu.
    Edit Page
  3. Drag the Glean Search / Glean Recommendations widget to the location you’d like it to appear on the page.
  4. 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.

Community search box
Community search results


An admin can configure the Glean widgets for Salesforce Community as a one-time activity by visiting the Glean app in Salesforce.

  1. As a System administrator, open the App menu and search for “Glean”. Glean app
  2. 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 form https://<your-glean-external-search-backend>

WebApp URL

This is the URL for your Glean deployment web. It can be set to https://<your-glean-external-search-subdomain> if one exists or

Client-auth API token

To obtain this key, an admin with sufficient access can head to https://<>/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:

  1. Select the gear in the upper-right of the page.
  2. Select Setup.
  3. Enter Session Settings in the Quick Find field.
  4. Select the Session Settings link in the left navigation bar.
  5. Uncheck the Use Lightning Web Security for Lightning web components box.
  6. Select Save.
  7. 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.


This step is only required if guest users can access the community site.

To access the guest user profile:

  1. Go to your community site builder page
  2. Click on “Settings” from the left-hand-side panel
  3. Click on the guest user profile link to access its settings. Enabled apex class access
  4. Click on "Enabled Apex class access" Enabled apex class access
  5. Move "glean.GleanCommunitySearchController" to "Enabled Apex classes" and click "Save". Enabled apex class access

(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.

  1. Go to "Setup" -> "Apex classes"
  2. Search for "GleanCommunitySearchController"
  3. Click on "Security"
  4. In the next page add the corresponding user profile. Enabled apex class access for a 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:

  1. Go to Setup
  2. Search for “App manager”
  3. In the App manager, locate your community site -> actions -> “Manage”.
  4. Select “Builder”. This will open the Salesforce experience app builder for your site.

Add Glean Search Box

  1. Select “Page structure” from the left menu, and select “Template Hero”
  2. Change the “Search component” from the menu on the right to “Glean search”. Page Settings

This can also be added to the compact header search if the theme you are using supports it.

Add Glean Search Results

  1. Click on the “edit” icon in the menu bar and select “Search”. Search page
  2. From the page structure menu on the left, remove “Global search results”. Search page | remove default results component
  3. 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.
  4. Include a search input with the search results.
  5. Select the Glean search results component and enable “Show inline search box”. Search page | Inline search box

(Optional) Customize the search results page to ensure it has full width and no padding / margins:

  1. Select “Theme settings” from the left menu.
  2. Disable “Set max page width”.

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:

  1. Go to the customer support page in the site builder.
    Find contact support
  2. Remove the default Case deflection widget from the page.
  3. Drag and drop "Glean Case Deflection" from the component menu to the Sidebar next to the Support request form. Community widgets
    Case deflection preview


Click on "Preview" and verify your changes before publishing to your site.


Lastly, click on “Publish” to publish your changes. Note that this will make the changes live on your site.