--- title: "Steps to Inject User Data into Beamer script in React" slug: "steps-to-inject-user-data-into-beamer-script-in-react" updated: 2025-10-08T16:41:19Z published: 2025-10-08T16:41:19Z canonical: "help.userflow.com/steps-to-inject-user-data-into-beamer-script-in-react" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.userflow.com/llms.txt > Use this file to discover all available pages before exploring further. # Steps to Inject User Data into Beamer script in React ### Way 1: Lazy Loading and Updating User Data Dynamically #### Modify the `index.html` File: In your `public/index.html` file, configure Beamer to initialize lazily by adding the `lazy: true` parameter to the `beamer_config` object: ```      Your App Title          
``` #### Update User Data and Initialize Beamer in React: Once user data is available in your React application, you can call the `Beamer.update()` method to pass in the user details and initialize Beamer. Example: ``` import React, { useEffect } from 'react'; function App() {  useEffect(() => {    const userData = {      user_id: '1234',      user_firstname: 'Jane',      user_lastname: 'Doe',      user_email: 'jdoe@rollstack.com'    };    if (window.Beamer) {      window.Beamer.update(userData);    }  }, []);  return (    
     {/* Your app content */}    
 ); } export default App; ``` ### **Way 2: Inject User Data into Beamer Using React Helmet** #### Install React Helmet: If you haven’t already installed react-helmet, you can do so using npm or yarn: npm install react-helmet# oryarn add react-helmet #### Locate the Component Where You Want to Embed Beamer: You can add the Beamer script in the root component (e.g., **App.jsx**) or any other component that is rendered at the start of your application. #### Import and Use React Helmet: In the selected component, import **Helmet** from **react-helmet** and inject the Beamer script with the user-specific data. ``` import React from 'react'; import { Helmet } from 'react-helmet'; function App() {  // Replace these with actual user data  const userEmail = "user@example.com";  const userName = "John Doe";  return (    <>                                  {/* Rest of your app */}      
       {/* Your app content */}      
     ); } export default App; ``` #### **Run Your Application:** - Save the changes. - Run your React application using `npm start` or `yarn start`. - Now, Beamer will be instantiated with the user-specific data (email and name) passed dynamically.