open-index/open-npm huggingface dataset:
npm package: @nezdemkovski/plugin-template-generator
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.0.7

# plugin-template-generator

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build plugin-template-generator` to build the library.

## Running unit tests

Run `nx test plugin-template-generator` to execute the unit tests via [Jest](https://jestjs.io).
npm package: @nezhatnico/sayhey
Description: SayHey - A customizable live chat widget with Telegram integration
Latest version: 0.1.9

# SayHey

SayHey is a customizable React component for adding a live chat widget to your website, with Telegram integration.

## Installation

```bash
npm install @nezhatnico/sayhey```

## Usage

```import React from 'react';
import ChatWidget from '@nezhatnico/sayhey';

const App = () => {
  const handleSendMessage = async (message) => {
    // Implement your logic to send the message to Telegram
    console.log('Sending message:', message);
  };

  return (
    <div>
      <h1>My Website</h1>
      <ChatWidget
        greetings={['Hello!', 'Hi there!', 'Need help?']}
        onSendMessage={handleSendMessage}
      />
    </div>
  );
};

export default App;```


### Props

`greetings` (optional): An array of greeting messages to display randomly.
`onSendMessage` (required): A function to handle sending messages to your backend or Telegram.

### Development

Clone the repository
Install dependencies: npm install
Start development server: npm run dev
Build the package: npm run build

## Telegram Integration

To enable Telegram integration:

1. Create a Telegram bot using BotFather and obtain the bot token.
2. Get your Telegram chat ID.
3. Pass the token and chat ID to the SayHey component:

```jsx
import SayHey, { initializeTelegramBot } from '@nezhatnico/sayhey';

// Initialize the bot (do this once, e.g., in your app's entry point)
initializeTelegramBot('YOUR_TELEGRAM_BOT_TOKEN');

// In your component
const App = () => {
  return (
    <div>
      <h1>My Website</h1>
      <SayHey
        greetings={['Hello!', 'Hi there!', 'Need help?']}
        telegramToken="YOUR_TELEGRAM_BOT_TOKEN"
        telegramChatId="YOUR_TELEGRAM_CHAT_ID"
      />
    </div>
  );
};
```