Interworky
  • Home
  • Introduction to Interworky
  • Getting Started
    • Account Setup Guide
  • Integration Tutorials
    • WordPress
    • Wix
    • Squarespace
    • Duda
    • Odoo
    • Next.js
    • React
  • Django
  • Features Overview
    • AI Agent Customization
      • Website Sync
      • Naming & Personality
      • Profile Picture
      • Opening Statement
      • First Message
      • Custom Knowledge Base
      • Customizing the Theme
      • Knowledge Files
    • Capabilities
      • Managed Capabilities
      • Custom Capabilities
      • Importing Custom Capabilities via Postman Collection
    • Interworky Dashboard
    • Interworky AI Agent
    • Post-Visit Survey AI Agent
    • Appointments System
  • Support and Resources
Powered by GitBook
On this page
  1. Integration Tutorials

React

Integration Tutorial: Adding Interworky AI Agent to Your React Website

PreviousNext.jsNextDjango

Last updated 23 days ago

Start your free trial now at

Step-by-Step Guide:

1. Log into the Interworky Dashboard

• After creating your Interworky account, log into the Interworky dashboard.

• Navigate to the Integration Page.

  1. Locate the Embed Code

  • In the Integration Page, locate the Embed Code section.

  • Capture your api-key next to data-api-key=

  1. Create the Interworky Component

Create Interworky Component in your react project, copy and paste the code below

import { useEffect } from 'react';

const Interworky = ({ apiKey }) => {
  useEffect(() => {
    if (!apiKey) {
      console.error('[Interworky] Missing API key');
      return;
    }
    // create & inject the script
    const s = document.createElement('script');
    s.src =
      'https://storage.googleapis.com/multisync/interworky/production/interworky.js';
    s.async = true;
    s.setAttribute('data-api-key', apiKey);
    s.onload = () => {
      window.Interworky?.init();
    };
    document.body.appendChild(s);

    return () => {
      document.body.removeChild(s);
    };
  }, [apiKey]);

  return null;
};

export default Interworky;
  1. Add the Interworky Component to your Application

  • Include the Interworky component in your application where you want the assistant to be initialized.

For example, you can include it in your App.jsx or a specific page component.

Use the API Key from step 2

See Example below:

import React from 'react';
import Interworky from './components/Interworky';

const App = () => {
  return (
    <div>
      <h1>Welcome to My Website</h1>
      {/* Other application content */}
     <Interworky apiKey={"YOUR_API_KEY"}/>
    </div>
  );
};

export default App;

And Tadaa 🎉, you just integrated Interworky AI Agent into your React project.

If you have any questions about the Interworky React Integration, please reach out to our support team at . We're here to help!

hello@interworky.com
https://interworky.com
Integration Page - Interworky Dashboard
Integration Page (Copied) - Interworky Dashboard
Page cover image