Starting bot in react component

Hi , i am implementing bot to my react website , working it to show and hide the bot on onclick.

Instead of starting botpress through index.html ( windows.botpress.web.init …)
i want add these scripts in my react component , how to acheive it ? how can i add this in a component. ( i have tried helmet but it is not taking function in scripts ) please help

Hey @robinrao !

I understand that you would like to add the inject.js script to your React application. You would like to inject that script using a React component.

Here, you can find instructions on adding a script to your app using a React component.

Hope this helps!

How to Insert this in react component ?
tried it with helmet but didnt worked

host: ‘http://localhost:3002’,
botId: ‘sarah’,
botName: ‘Sarah’,
extraStylesheet: ‘http://localhost:3001/css/default.css’,
botAvatarUrl: ‘http://localhost:3001/images/user.svg’,
showConversationsButton: false, // Whether or not to show the conversations button
showUserName: false, // Whether or not to show the user’s name
showUserAvatar: false, // Whether or not to show the user’s avatar
enableTranscriptDownload: false, // Whether or not to show the transcript download button
enableArrowNavigation: false, //Whether or to to support arrow navigation (e.g scroll conversation, focus on buttons)
externalAuthToken: ‘my jwt token’, // Defines a token that is sent with each messages to Botpress
userId: null, // Allows you to override the default user id. Make sure it is not possible to guess it!
enableReset: true});