For Affiliates

Installation

Add the Exlitem search widget to your website with a script tag and HTML element.

2 min read

Adding the widget to your site takes two steps: include the script, then place the HTML element where you want the search to appear.

#Quick Start

Add these two lines to any page:

<!-- 1. Place the widget element -->
<exlitem-search api-key="YOUR_PUBLISHABLE_KEY"></exlitem-search>

<!-- 2. Load the widget script (before </body>) -->
<script src="https://cdn.exlitem.com/widget/exlitem-search.js"></script>

That's it. The widget will render a search input and display results when visitors type a query.

#Step-by-Step

#1. Add the Script Tag

Place the script tag just before the closing </body> tag on any page where you want the widget:

<script src="https://cdn.exlitem.com/widget/exlitem-search.js"></script>

The script registers the <exlitem-search> custom element. It only needs to be loaded once per page, even if you use multiple widgets.

#2. Place the Widget Element

Add the <exlitem-search> element wherever you want search to appear:

<exlitem-search api-key="YOUR_PUBLISHABLE_KEY"></exlitem-search>

Replace YOUR_PUBLISHABLE_KEY with the publishable key from your affiliate account (starts with exl_pub_live_).

#3. Verify It Works

During development, use your test publishable key (starts with exl_pub_test_) to avoid consuming your daily search quota. Test keys return sample data and don't count toward rate limits.

<exlitem-search api-key="exl_pub_test_YOUR_KEY"></exlitem-search>

#Framework Guides

#Plain HTML

<!DOCTYPE html>
<html>
<body>
  <h1>Find an Expert Witness</h1>
  <exlitem-search api-key="exl_pub_live_abc123"></exlitem-search>
  <script src="https://cdn.exlitem.com/widget/exlitem-search.js"></script>
</body>
</html>

#WordPress

  1. Go to Appearance > Widgets (or use the block editor)
  2. Add a Custom HTML block where you want the widget
  3. Paste the <exlitem-search> element
  4. Add the script tag to your theme's footer (or use a plugin like "Insert Headers and Footers")

#Squarespace

  1. Go to the page where you want the widget
  2. Add a Code Block (from the insert menu)
  3. Paste both the element and script tag
  4. Make sure "Display Source" is unchecked

#React / Next.js

Since the widget is a Web Component, it works in React without any wrapper:

export default function SearchPage() {
  return (
    <>
      <exlitem-search api-key="exl_pub_live_abc123" />
      <script src="https://cdn.exlitem.com/widget/exlitem-search.js" />
    </>
  );
}

#Troubleshooting

  • Widget not appearing? Check that the script is loaded and your API key is correct.
  • Console errors about CORS? Make sure your domain is in the allowed domains list for your affiliate account.
  • Blank results? Verify you're using a live key (not test) for production, and that your daily search quota hasn't been exhausted.