npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hmcts/ctsc-web-chat

v0.3.12

Published

HMCTS CTSC Web Chat

Downloads

541

Readme

ctsc-web-chat

Node module for CTSC web chat service

Quick start

# Add this module as a dependency to your web application using Yarn:
yarn add @hmcts/ctsc-web-chat

Table of Contents

Usage

This node module packages the CSS and javascript required to support the HMCTS CTSC web chat service. Once the node module has been added into your own web application, you should ensure that the assets/css and assets/javascript directories are added to your web server configuration for serving static files. For example, if using Express:

app.use('/webchat', express.static(path.join(__dirname, '/node_modules/@hmcts/ctsc-web-chat/assets')));

This allows the CSS to be accessed via /webchat/css/hmcts-webchat.css and the javascript to be accessed via /webchat/javascript/hmcts-webchat.js.

In the page where you want the chat link to appear, you need to create an empty div element with id ctsc-web-chat:

<div id="ctsc-web-chat"></div>

And at the end of the page, include the javascript, and finally call the webchat_init function, for example:

<script src="/webchat/javascript/hmcts-webchat.js"></script>
<script nonce="{{ nonce }}">
    webchat_init({
        uuid: 'script_12345678',
        tenant: 'abc123',
        channel: 'My service',
        stylesheetURL: '/webchat/css/hmcts-webchat.css'
    });
</script>

The webchat_init function takes a dictionary consisting of the following parameters:

|Parameter |Default |Description | |------------------|--------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |uuid |n/a |UUID value (obtain this from CTSC team) | |tenant |n/a |tenant ID value (obtain this from CTSC team) | |channel |n/a |Channel name (obtain this from CTSC team) | |stylesheetURL |n/a |URL of the webchat stylesheet (from this node module). This should either be absolute and starting 'https:', or a path relative to root. The CSS must be served over CSS; if it isn't (for instance running locally for development), a URL pointing to the github master CSS mirrored in jsdelivr (to deliver the correct MIME type) will be used instead| |busPublishInfo |n/a |Optional dictionary object of information to be passed to agent e.g. { 'Logged in ID': sLoginId, 'Case ID': sCaseId } | |busPublishLanguage|'en' |Language to display text in web chat window. 'en' is English, 'cy' is Welsh. | |domain |'https://vcc-eu4.8x8.com' |8x8 domain (this should not need to be changed) | |path |'/.' |Path to 8x8 javascript (this should not need to be changed) | |buttonContainerId |'ctsc-web-chat' |The ID of the div element where the link should be rendered | |linkText |'Chat online with an agent', |The text to be displayed in the link that activates the web chat | |additionalText |'(Monday to Friday, 9.00am to 5.00pm)'|Additional text to be displayed under the link that activates the web chat |

LICENCE

This project is licensed under the MIT License - see the LICENSE file for details.