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 🙏

© 2025 – Pkg Stats / Ryan Hefner

mp70-react-component

v0.0.30-alpha.25

Published

This guide is designed for developers looking to integrate the `AplisayWidget` into a React application, with flexible options for applying both Tailwind CSS and traditional CSS styling directly through props.

Downloads

76

Readme

# AplisayWidget Integration Guide

This guide is designed for developers looking to integrate the `AplisayWidget` into a React application, with flexible options for applying both Tailwind CSS and traditional CSS styling directly through props.

## Setup

### Dependencies

Ensure you have `react` installed in your project. If you plan to use Tailwind CSS, make sure it's also set up:

```bash
npm install react tailwindcss@latest postcss@latest autoprefixer@latest --save-dev
```

Configure Tailwind by generating a config file:

```bash
npx tailwindcss init
```

Include Tailwind in your project's CSS:

```css
/* src/index.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
```

### Environment Configuration

Set the necessary environment variables for API connectivity:

- `REACT_APP_APLISAY_URL`: API URL.
- `REACT_APP_APLISAY_AGENT`: Listener ID.
- `REACT_APP_APLISAY_KEY`: Room authentication key.

## Component Integration

Import `AplisayWidget` into your application and control its presentation through state hooks and style props. Below is a full example including dynamic style passing:

```javascript
import React, { useState } from 'react';
import AplisayWidget from './components/AplisayWidget';

const AgentPopout = () => {
  const [open, setOpen] = useState(false);
  const handleOpen = () => setOpen(true);
  const handleClose = () => setOpen(false);

  // Styling options: Tailwind CSS for utility classes, inline styles for specific attributes
  const widgetStyles = {
    style: { color: 'blue', backgroundColor: 'white', padding: '20px' },
    className: "text-lg bg-gray-100 p-5 border border-gray-200 rounded shadow-lg"
  };

  return (
    <>
      <button className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" onClick={handleOpen}>
        Open Widget
      </button>
      {open && (
        <div className="fixed inset-0 flex items-center justify-center p-4">
          <AplisayWidget
            url={process.env.REACT_APP_APLISAY_URL}
            listenerId={process.env.REACT_APP_APLISAY_AGENT}
            roomKey={process.env.REACT_APP_APLISAY_KEY}
            open={open}
            setOpen={setOpen}
            verbose={true}
            {...widgetStyles}
          />
          <button className="absolute top-0 right-0 p-2" onClick={handleClose}>Close</button>
        </div>
      )}
    </>
  );
};

export default AgentPopout;
```

## Styling Flexibility

The `widgetStyles` object is used to pass inline styles and Tailwind utility classes. Adjust these properties to match the styling requirements of your project. This method ensures that the widget can be easily themed to align with various design systems or preferences.

## Notes

- Ensure that your build process includes CSS processing for Tailwind if used.
- Customize environment variables and styling as needed to fit the application context.