@talksprout/react
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Talksprout React Component

The Talksprout component is a utility for integrating the Talksprout script into your React application. Talksprout is a platform for facilitating communication and collaboration. This component simplifies the process of injecting the Talksprout script into your app.

Installation

To use the Talksprout component in your React application, follow these steps:

  1. Install the talksprout package if you haven't already:
npm install @talksprout/react
  1. Import the necessary components and hooks:
import React from "react";
import { Talksprout } from "talksprout";
  1. Use the Talksprout component in your app:
const App = () => {
  const workspaceId = "YOUR_WORKSPACE_ID"; // Replace with your Talksprout workspace ID

  return (
    <div>
      {/* Your other app content */}
        <Talksprout 
            id={workspaceId} 
            user={'user@yourcompany.com'}
            trigger={
                <button>Open Talksprout Widget</button>
            } 
        />
    </div>
  );
};

export default App;

Props

The Talksprout component accepts the following props:

  • id (required): The ID of your Talksprout workspace.
  • trigger: A React element that, when clicked or triggered, opens the Talksprout communication interface.
  • user: An optional string representing the user associated with the Talksprout interaction - for example this could be the users email from you apps identity provider.
  • children: An optional React element or function that receives data props and returns a React element.

Readme

Keywords

none

Package Sidebar

Install

npm i @talksprout/react

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

18.5 kB

Total Files

39

Last publish

Collaborators

  • talksprout