Livechat Widget Development and Customization
    • Dark
      Light
    • PDF

    Livechat Widget Development and Customization

    • Dark
      Light
    • PDF

    Article summary

    Change Livechat host

    One of the initial steps in Livechat widget development is to ensure that it points directly to the running Rocket.Chat server.

    To select a different host for your local widget, navigate to /src/api.js file in the project directory.

    It contains this code snippet:

    const host = window.SERVER_URL
    	|| queryString.parse(window.location.search).serverUrl
    	|| (process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : null);

    You can modify your server's URL in that code snippet like this:

    const host = window.SERVER_URL
    	|| queryString.parse(window.location.search).serverUrl
    	|| (process.env.NODE_ENV === 'development' ? 'https://your.rocketserver.com' : null);

    Available CLI commands

    # install dependencies
    yarn
    
    # serve with hot reload at localhost:8080
    yarn start
    
    # build preact application to "build" folder
    yarn dev
    
    # build for production with minification
    yarn build
    
    # test the production build locally
    yarn serve
    
    # run tests with jest and preact-render-spy
    yarn test
    
    # run the storybook
    yarn storybook
    
    # before commit run
    yarn i18n

    Customization

    The Livechat widget can be fully customized using our Storybook components. You can use the LiveChat Widget API to extend functionalities.


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.
    ESC

    Eddy AI, facilitating knowledge discovery through conversational intelligence