@opaper/chat-widget
v0.1.1
Published
Embeddable chat widget for Lumi
Readme
@lumi/chat-widget
A React component for embedding Lumi chat functionality into any website.
Installation
# Using npm
npm install @lumi/chat-widget
# Using yarn
yarn add @lumi/chat-widget
# Using bun
bun add @lumi/chat-widgetUsage
import { ChatWidget } from '@lumi/chat-widget';
function App() {
return (
<div>
<h1>My Website</h1>
<p>Welcome to my website!</p>
{/* Add the ChatWidget component */}
<ChatWidget organisationId="your-organisation-id" />
</div>
);
}Props
| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | organisationId | string | Yes | - | Your Lumi organisation ID | | baseUrl | string | No | '' | Base URL for API endpoints. If not provided, it will use the current host. |
Development
# Build the package
bun run build
# Run in development mode with watch
bun run dev
# Type check
bun run typecheckPublishing
This package is automatically published to npm when a new GitHub release is created. The publishing process is handled by a GitHub Action workflow.
Release Process
- Update the version in
package.json - Commit the changes and push to the main branch
- Create a new GitHub release with a tag in the format
@lumi/[email protected] - The GitHub Action will automatically:
- Build the package
- Verify that the package version matches the release tag
- Check if the version already exists on npm
- Publish the package to npm using Bun if it doesn't already exist
Requirements
- An
NPM_TOKENmust be added to the repository secrets to authenticate with npm - The package version in
package.jsonmust match the version in the GitHub release tag - The GitHub release tag must be in the format
@lumi/chat-widget@version(e.g.,@lumi/[email protected])
License
MIT
