Skip to content

Embedding LibChat into Primo NDE

Jerry Yarnetsky edited this page Apr 9, 2026 · 13 revisions

The normal embed code for LibChat unfortunately won't work in Primo. We need to include the LibChat URL into a script inserted into the custom.js file, which is part of the Customization package.

  1. Your starting point is the embed code for your preferred LibChat queue. This is ours...
<script src="https://libanswers.lib.miamioh.edu/load_chat.php?hash=b81f60084589f2d6a37b0cf4420a7a9d11eb67b362a45685ae5b79b41005310d" async></script>
  1. Extract just the server and hash part of the URL, for example...
libanswers.lib.miamioh.edu/load_chat.php?hash=b81f60084589f2d6a37b0cf4420a7a9d11eb67b362a45685ae5b79b41005310d
  1. Take this URL and insert it into this JS the custom.js file in the example below

Here's the file's path: Primo View folder > assets > js > custom.js

tip: copy/paste this code block into your code editor to see the //comment on where to add you url/hash...

(function () {
  ('use strict');
  ('use strict');

  // Adds the chat button
  (function () {
    var lc = document.createElement('script');
    lc.type = 'text/javascript';
    lc.async = 'true';
    lc.src =
      ('https:' == document.location.protocol ? 'https://' : 'http://') +
      'libanswers.lib.miamioh.edu/load_chat.php?hash=b81f60084589f2d6a37b0cf4420a7a9d11eb67b362a45685ae5b79b41005310d'; // URL here!
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(lc, s);
  })();
  // End the chat button 
})();

It's important that you use your own LibChat server and hash or your questions may route to Miami University in Ohio.

This blog post from ExLibris helped me get this working.

Clone this wiki locally