Skip to main content
All CollectionsUserWay Widget: Platform Installation Guides
How to integrate the UserWay Widget with a React Application
How to integrate the UserWay Widget with a React Application
Updated over 3 months ago

In this article, we will walk you through the installation process of UserWay in a React application.

To integrate UserWay into your React application, we will utilize the inline script addition method, which is suitable for short scripts that are specific to a particular component or page. We will explore the use of JSX components to achieve this.

  1. Add this code directly within your component's JSX code:

    import React from 'react';

    const UwScriptComponent = () => {
    return (
    <div> {/* JSX code */} <script src="https://cdn.userway.org/widget.js" data-account="YOUR_DATA_ACCOUNT"></script>
    </div>
    );
    };

    export default UwScriptComponent;


    Make sure to replace [YOUR_DATA_ACCOUNT] with your Account ID code.

  2. After adding the script, save the changes and start the React application:

    # NPM START

Please ensure that your React component does not interfere with the final print or modify the data provided by the script.

If you look to manually add the Script inside your <body>, we have a tutorial here.

Did this answer your question?