Embed ServiceNow components instance on the third-party website

task australia Updated Sep 10, 2026 5 min read embed-web-components-third-party-website.md
Raw file servicenow.com

Embed the global code and component code for configured components on your third-party website so customers can use them.

Before you begin

At least one ServiceNow component must be configured in your instance. For more information, see Configure the ServiceNow component instance.

Role required: none

About this task

When you select Get embed code for a component instance, your instance generates two blocks of code:

  • Global code connects your website to your instance. You add it once to your website.
  • Component code adds one component instance to a page. You add it for each component instance that you want to display.

This procedure outlines the high-level steps that you must follow to embed Web Embeddables component instance on your third-party website.

Procedure

  1. In the HTML file of your third-party website, paste the global code that you copied.

    Note: The global code only needs to be added once to your third-party website, even if you embed more than one component.

  2. In the global code, update the getTokenCallBack and getGuestJWTTokenCallBack functions to return the authentication token and guest token for the current user.

    The generated functions contain placeholders. For more information about authentication, see Authenticate the ServiceNow components using OIDC and Non OIDC authentication for ServiceNow components.

  3. In the HTML file of the page or section where you want the component to appear, paste the component code that you copied.

    Use the page or section that matches the group that contains the component instance in your module. If you turned on the Enable event handler toggle when you copied the code, the component code also includes a script block with event handlers. Event handlers run your code when users interact with the component, for example when they select a record.

  4. Update the component code for your website.

    For example, replace the placeholder page URLs in the event handlers with the URLs of your own pages. For component-specific instructions, see:

  5. Open the website in a browser to verify that it launches the component.

Result

The ServiceNow component instance that you embedded appears on your third-party website.

If the component doesn't appear on your website, check the following:

Search documentation
Search document titles and file paths on the australia branch