Documentation
Make sure you have React v16.8 or higher installed in your project (hooks are required).
Install the @talksprout/react npm package:
npm i @talksprout/react --saveImport the talksprout component in the file where you want to use it:
import React from "react"
import { Talksprout } from "./Talksprout"Provide the required id and trigger props, and optionally the user prop to attach a logged-in user's email or name to submissions.
const MyPageComponent = () => {
return (
<div>
<h1>My Page Component</h1>
<Talksprout id="exampleId" trigger={<button>My feedback button!</button>}>
{/* Optional: pass a child component as the trigger */}
<button>My alternative feedback button!</button>
</Talksprout>
</div>
)
}The id should be the workspace ID you want to collect feedback for.
Run your application and send some feedback through the widget to verify everything is working. Your submissions will appear in the talksprout dashboard.