@userback/react
Quickly integrate Userback via NPM or Yarn with this step-by-step guide and code samples
Overview
The official NPM module for embedding the Userback Widget into your React application.
- Official NPM Package: https://www.npmjs.com/package/@userback/react
- Official GitHub Repository: https://github.com/userback/widget-js/tree/develop/widget-react
Installation
To install any of the packages and embed Userback, you'll need a Widget Access Token.
NPM Installation
npm i @userback/react
Quickstart
To embed the Userback Widget, use the following example code snippets:
JavaScript Example
import { UserbackProvider } from '@userback/react';
// identify your logged-in users (optional)
const user_data = {
id: "123456", // example data
info: {
name: "someone", // example data
email: "[email protected]" // example data
}
}
ReactDOM.createRoot(document.getElementById('root')).render(
<UserbackProvider token="**Widget Access Token**" options={{user_data: user_data}}>
<App />
</UserbackProvider>
);
For advanced customization information, refer to our JavaScript SDK documentation.
We hope this guide helps you seamlessly integrate the Userback Widget into your React application. If you have any questions or need further assistance, please visit the Userback Help Center for additional resources and support.
Updated 9 months ago
Whatβs Next