1.0.3 • Published 9 months ago
@talksprout/react v1.0.3
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:
- Install the
talksprout
package if you haven't already:
npm install @talksprout/react
- Import the necessary components and hooks:
import React from "react";
import { Talksprout } from "talksprout";
- 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.