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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@element-public/react-chatbot

v5.72.2-alpha.1

Published

Chatbot component for Element React

Downloads

164

Readme

Chatbot

Description

A reusable chat bubble component that integrates AI-powered conversations across Bayer applications. Provides assistantId prop, which allow to reach several assistants within MyGenAssist.

See live demos on storybook

Storybook Chatbot Demos

Install from Artifactory

  • Verify that you have access to (https://docs.int.bayer.com/cloud/devops/artifactory/)[Bayer Artifactory]
    • Verify your token is correctly set up in your .npmrc as per the link above
  • Verify you have the @element scope configured in your .npmrc
    • @element:registry=https://artifactory.bayer.com/artifactory/api/npm/npm-platforms-engineering/
  • Install the component and themes bundles
    • npm i @element/react-components @element/themes
      • alternatively install the component individually along with the themes bundle npm i @element/react-chatbot @element/themes

Notes

A reusable chat bubble component that integrates AI-powered conversations across Bayer applications. By using assistantId prop, chatbot can reach custom assistants with public access available on MyGenAssist.

Props

| Prop | Type | Required | Description | | ------------- | ------ | -------- | ------------------------------------------------------------------ | | assistantId | string | Yes | The unique identifier of the MyGenAssist assistant you want to use |

Events

| Event | Description | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | onAuth | Custom event enabling end developers to implement their own authorization flow. Returns an auth token, that is passed directly to the component. | | onChatClose | Custom event which allows to create custom method for clearing authorization state inside component when chat is closed. |

Usage

Use the assistantId prop to specify which MyGenAssist assistant you want to connect

// Example with Elle assistant ID
<Chatbot assistantId='e5ca8a9a-1739-4b93-8e6c-62932026cd21' />

In the default flow, the auth token for authorization with MyGenAssist should be pasted directly in the chat, but if you want to customize the authorization flow with SSO or custom token management, you should use onAuth that allows you to create custom authorization. If the authorization flow require high level of complexity, the onAuth should be used only to return correct auth token, which will be passed directly to component and encrypted inside.

The onChatClose event should be used for customizing of clearing auth state inside component when chat is closed. In default flow, closing chat clears the session and auth token, but if you using complex auth flow that could store token in some cookies or states, you should use also onChatClose event that clears custom auth state.

// Example with custom onAuth
<Chatbot assistantId="e5ca8a9a-1739-4b93-8e6c-62932026cd21"
         onAuth={() => {
            return authToken;
         }}
         onChatClose={() => clearAuthState();}
/>

Chatbot Props

| Name | Type | Default | Required | Description | | ----------- | ------ | --------- | -------- | ---------------------------------------------------------------- | | assistantId | string | undefined | false | Allows to reach several assistants within MyGenAssist | | className | string | undefined | false | The css class name to be passed through to the component markup. |

Chatbot Events

| Name | Default | Required | Params | Description | | ----------- | ------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | | onAuth | null | false | | Custom event enabling end developers to implement their own authorization flow. Returns an auth token, that is passed directly to the component. | | onChatClose | null | false | | Custom event which allows to create custom method for clearing authorization state inside component when chat is closed. |

Chatbot Message Props

| Name | Type | Default | Required | Description | | --------- | ------ | --------- | -------- | ---------------------------------------------------------------- | | className | string | undefined | false | The css class name to be passed through to the component markup. |