---
sourceDocument: Australia Customer Service Management
sourceDocumentLink: https://www.servicenow.com/docs/r/customer-service-management

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Customer Service Management

ft:clusterId :

    - csm

bundleId :

    - csm

workflow :

    - Customer and Industry


---

# Configure the Knowledge article

# Configure the Knowledge article view component instance {#ariaid-title1}

* Release version: Australia
* 
* Updated March 12, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read

Configure the Knowledge article view component instance so that your users can embed it on their website to access knowledge articles from their website directly.

## Before you begin

You must have the following setup to configure the Knowledge article view component instance:

* Enable Web Embeddables in your instance. For more information, see [Activate Web Embeddables](https://www.servicenow.com/docs/SncFxfwSEtIvlpyyqmxz2Q "You can enable the ServiceNow Components for Customer Service (sn_cx_components), Web components for Guest Embeddables (sn_guest_component), and Web Embeddable Core (sn_embeddable_core) to enable Web Embeddables on your instance. The application establishes related plugins if they aren’t already installed.").
* [Set up a custom URL as the instance URL](https://www.servicenow.com/docs/AUV_G7eDelxzB0TOTC77XQ "Add a custom URL to your instance configuration to use instead of your ServiceNow URL. This custom URL ensures that embedded components remain accessible in your browser, even when third-party cookies are turned off.").
* Authenticate the ServiceNow components using OpenID Connect (OIDC) or non OIDC authentication. For more information, see [Authenticate the ServiceNow components using OIDC](https://www.servicenow.com/docs/2qubcZxyeA~7lMiUblY_1A "Set up auto-login and log out using OpenID Connect (OIDC) authentication to enable single and simultaneous login and logout in your website and embedded components.") and [Non OIDC authentication for ServiceNow components](https://www.servicenow.com/docs/NSuUm~8N16GNvUb_7cANqA "Generate a JSON Web Token (JWT) token to authenticate your ServiceNow components if your website doesn’t use OpenID Connect (OIDC) authentication.").
{#config-know-article-view-comp__ul_brf_cqf_ccc}

Role required: sn_embeddable_core.emb_admin

## Procedure

1. Navigate to AllWeb EmbeddablesHomepage.
2. In the homepage, select Create module or use the existing module.  
   For more information on creating a new module, see [Create a module](https://www.servicenow.com/docs/cUVM5bfe0riPnY~5QKYQVg "Create a module to manage component instances used in a website. You can either create a module or use a prebuilt module and edit it according to requirement.").
3. On the module page, in the Components tab, add a Knowledge article view component instance to an existing or a new group.  
   For more information on creating a group and then adding a component instance, see [Create a group and add a component instance](https://www.servicenow.com/docs/0FL_ZYd~25yNfBreXHKjVQ "Create a group to model third-party website structure such as page or sections. Use the default group or create new groups to manage the component instances on that page or section.").
4. **Optional:** Toggle the Show static preview option to see a visual representation of a component when a live preview isn't available.  
   Note:  
   When enabled, any changes to the global or component properties don't appear in the Preview tab in real-time.
5. Configure the Knowledge article view component instance properties.  
   * The Preview tab displays real-time data according to choices set in the component properties.
   * For a description of the component properties related to the Knowledge Article component instance, see [Component properties for the Knowledge article view](https://www.servicenow.com/docs/Kd2dFrn7Tuc7yhR5tgFRbQ "Component property enables you to configure the behavior of the Knowledge article view component instance on the third-party website.").
   {#config-know-article-view-comp__ul_jlw_yjw_cfc}
6. Select the CORS rules tab to configure the CORS rules.  
   For more information about configuring CORS rules, see [Configure CORS (Cross-Origin Resource Sharing) rules before embedding ServiceNow components](https://www.servicenow.com/docs/mgugMWeiw1SNjGgjJDaCOQ "Configure a CORS rule to enable cross-domain requests between ServiceNow components and the website that you want to embed the web components.").
7. Select the Components tab.  
   If a message appears about the application scope, change the scope to Web Components for Customer Service to be able to edit the record.
8. Select Get embed code.  
   A pop-up window appears to display both Global code and Component code.
9. In the Global code tab, review the generated code and select the Copy global code.  
   The global code only must be added once to your third-party webpage.

       import { init, login, logout, startGuestSession } from 'https://demo.servicenow.com/uxasset/externals/sn_embeddable_core/index.jsdbx';

       await init({
           theme: 'fad87d2ca304121029a4d1aed31e610f',  /* sys_id of the theme to use for the embeddable components in your website */
           baseURL: 'https://demo.servicenow.com', /* Base URL of the instance to be used for the embeddable components in your website */
           authCallback: getTokenCallBack, /* Function which returns the auth token for the current user, required for auth setup */
           module: '591800ffc1243610f87714367ed47c6a', /* Demo module */
           pageName: document.title, /* Uses the browser's document title as the page name in User analytics experience */
           guestTokenCallback: getGuestJWTTokenCallBack, /* Function which returns the guest token for the current user, required for guest validation setup */
           cacheComponents: [] /* Pre-caches resources for improved performance. Update component list as per your usage */
       });

       function getTokenCallBack() {
           var idToken; /* Get the id token for the current user */
           return Promise.resolve(idToken);
       }

       function getGuestJWTTokenCallBack() {
           var guestToken; /* Get the guest token for the current user */
           return Promise.resolve(guestToken);
       }

       /* Uncomment below function to handle guest session */
       // await startGuestSession();

       /* Uncomment below functions to handle login and logout once the user logs into your website */
       // await login();
       // await logout();

10. **Optional:** In the Component Code tab, slide the Enable event handler toggle switch to handle events triggered by the user interactions on the webpage.  
    Note:  
    Enabling the event handler also modifies the component code. For more information on event handlers in Web Embeddables, see [Event handler in the Knowledge article view component](https://www.servicenow.com/docs/_rDG0xcnYEIEVscBT9uEEQ "A component triggers an event when a certain condition is met or on user interaction. The event can be used to execute an action through a code on a third-party webpage.").
11. In the Component code tab, review the generated code and select the Copy component code.  
    This generated code also includes event handlers.

        <!--  
            Module: Demo module
            Group: Group 1
            Instance: Knowledge article view 1
        -->
        <sn-embedx-kb-article-view record-id="9d25b5b8dbd92200d75270f5bf96198b"></sn-embedx-kb-article-view>
        <!--
        	The component also includes the following additional properties:
        	hide-header
        	hide-language-selector
        	hide-author-information
        	hide-reading-time
        	hide-last-updated
        	hide-view-count
        	hide-average-rating
        	hide-attachments
        	hide-helpful-option
        	hide-article-rating
        	disable-displaying-latest-article-version
        	hide-errors
        	hide-notifications
        -->

        <script type="module">
        	import { getEmbeddables, setEvents, setProperties } from 'https://demo.servicenow.com/uxasset/externals/sn_embeddable_core/index.jsdbx';
        	
        	const snEmbedxKbArticleView = document.querySelector('sn-embedx-kb-article-view');

        	getEmbeddables(["sn-embedx-kb-article-view"]);

        	const eventHandlers = {
        		'SN_EMBEDX_KNOWLEDGE_ARTICLE_VIEW#BACK_BUTTON_CLICKED' : (e) => {
        			// Event for back button clicked on mobile variant of knowledge article view.
        			//Redirect to the knowledge browse page
        			open('/knowledgebrowse', '_self');
        		},
        		'SN_EMBEDX_KNOWLEDGE_ARTICLE_VIEW#RATING_CLICKED' : (e) => {
        			// This event is dispatched when rating is provided for the article
        			var {rating} = e.detail.payload;
        			console.log(rating);
        		},
        		'SN_EMBEDX_KNOWLEDGE_ARTICLE_VIEW#LANGUAGE_DROPDOWN_CLICKED' : (e) => {
        			// This event is dispatched when language dropdown selection is clicked
        			var {articleID} = e.detail.payload;

        			// Set properties for the knowledge article view
        			setProperties(snEmbedxKbArticleView, {recordId: articleID});
        			
        		},
        		'SN_EMBEDX_KNOWLEDGE_ARTICLE_VIEW#NOTIFICATION_LINK_CLICKED' : (e) => {
        			// This event is dispatched when link present on notification has been clicked
        			var {table, sys_id} = e.detail.payload;

        			if(table == 'kb_knowledge') {
        				// Set properties for the knowledge article view
        				setProperties(snEmbedxKbArticleView, {recordId: sys_id});
        			}
        		},
        		'SN_EMBEDX_KNOWLEDGE_ARTICLE_VIEW#COMPONENT_READY' : (e) => {
        			// This event is dispatched when a component is ready and usable.
        		},
        		'SN_EMBEDX_KNOWLEDGE_ARTICLE_VIEW#COMPONENT_ERROR' : (e) => {
        			// This event is dispatched when a property validation or internal error occurs.
        			var {errorMessage, errorType} = e.detail.payload;
        			console.log(errorMessage, errorType);
        		},
        		'SN_EMBEDX_KNOWLEDGE_ARTICLE_VIEW#LINK_CLICKED' : (e) => {
        			// This event is dispatched when a record link has been clicked inside article body
        			var {table, sys_id} = e.detail.payload;
        			console.log(table, sys_id);
        		}
        	};

        	setEvents(snEmbedxKbArticleView, eventHandlers);
        </script>

{#config-know-article-view-comp__steps_kkl_1fn_ddd}

## Result

The global and component codes are ready to be shared with the third-party administrator to embed the Knowledge article view component instance on their third-party website.

## What to do next

[Embed the Knowledge article view component instance on the third-party website](https://www.servicenow.com/docs/zVp_NQ7JyqTBEcAi2XDkbw "Embed the global code and component code of the Knowledge article view component instance that you configured so that you can enable your customers to start using the Knowledge article view component instance on your third-party website.")
**Related reference**   

* [Component properties for the Knowledge article view](https://www.servicenow.com/docs/Kd2dFrn7Tuc7yhR5tgFRbQ "Component property enables you to configure the behavior of the Knowledge article view component instance on the third-party website.")
* [Event handler in the Knowledge article view component](https://www.servicenow.com/docs/_rDG0xcnYEIEVscBT9uEEQ "A component triggers an event when a certain condition is met or on user interaction. The event can be used to execute an action through a code on a third-party webpage.")
* [Sample code for the Knowledge article view component](https://www.servicenow.com/docs/FNO5qGFY_WR3k8wfY_VX3w "Sample code is provided to define an action when an event is triggered. Update the sample code for your use case before embedding the component on your webpage.")

*[\>]: and then


