Hazelchat
Start free

Add an AI chat agent to your Drupal site

Hazelchat answers your visitors from the pages and documents you approved, shows the sources under every answer and passes enquiries on to you. A free module adds it to every public page of your Drupal site: no theme editing.

Version 1.0.0 for Drupal 10.3 and later and Drupal 11. The Free plan includes 50 answers a month on one website, with no card, and stays free.

How the Hazelchat module works on Drupal Your content, answers, enquiries and billing stay in Hazelchat. You paste your installation code into the module's settings. The module keeps only its key and one consent setting, sends nothing from Drupal to Hazelchat, and adds one script to the public pages of your site, where visitors get answers with their sources. Hazelchat Content, answers, enquiries and billing Your installation code You paste it into the Hazelchat settings The Drupal module The key One consent switch Reads no pages, users or forms. Sends nothing. Adds one script to every public page of your site Your public pages A visitor's question Answer from your pages Sources (1)

What you need

  • Drupal 10.3 or later, or Drupal 11, with PHP 8.1 or later. No other modules.
  • Access to Composer for your site (or someone who has it, such as your agency), and a Drupal account with the "Administer site configuration" permission.
  • A Hazelchat account. The module needs the hosted Hazelchat service; the Free plan includes 50 answers a month on one website, with no card.

Add Hazelchat to Drupal in six steps

  1. In Hazelchat

    Prepare your agent

    Add your content, check the details and try your agent. Under Website → Install on your website, add your website's domain.

  2. In Hazelchat

    Copy the installation code

    Copy the installation code. It holds your public widget key, which is not a password.

  3. In Drupal

    Install the module

    Run composer require drupal/hazelchat in your site's folder, then turn on Hazelchat under Extend (or run drush en hazelchat). Installing it alone loads nothing on your site.

  4. In Drupal

    Paste the code

    Go to Configuration → Web services → Hazelchat, paste the code into Installation code and click Save configuration. Only the key is kept. Drupal clears its own page caches for you.

  5. In Drupal

    Remove old snippets

    If you pasted a Hazelchat script into your theme or a block before, remove it so the chat loads once. If a proxy or CDN caches your pages, clear it too.

  6. On your site

    Switch it on and test it

    Back in Hazelchat, click Publish and switch on (or Switch on if your published agent is unchanged). Hazelchat checks that the script is on your website before the agent goes live. Then open your website, ask a question in the chat, return to Hazelchat and click Yes, I saw this answer.

What the module does

It adds one script to your public pages and nothing else. Your content, answers, enquiries and billing all stay in your Hazelchat workspace.

The module adds https://app.hazelchat.co/widget.js, with your public key, to the head of your public HTML pages. It stores only that key and one consent setting, has no database tables and no JavaScript of its own, and sends nothing from Drupal to Hazelchat. Administration pages and feeds never load the chat. Its settings page is in English and German, and it is free software under the GPL, version 2 or later.

Caching and security headers

  • Page caches

    Drupal's own caches update when you save the settings. Clear any proxy or CDN in front of the site yourself.

  • Leave the script alone

    Exclude https://app.hazelchat.co/widget.js from script combining, rewriting or delayed loading. The script must keep its own address and key.

  • Content-Security-Policy

    If you send one (for example with the CSP module), allow https://app.hazelchat.co in script-src, connect-src and frame-src.

Change or remove

New widget key

If you rotate the key in Hazelchat, paste the new code on the Hazelchat settings page and save.

Pause the chat

Switch Hazelchat off in your workspace. It stops answering straight away, even on cached pages. Emptying the Installation code field removes the chat from your pages.

Remove it from the site

Uninstall the module under Extend → Uninstall (or drush pmu hazelchat), then composer remove drupal/hazelchat. Uninstalling removes its settings too. Your Hazelchat account and plan are not affected.

Updates and changes

New versions are published on drupal.org. Drupal's Update Status module tells you about them, and composer update drupal/hazelchat installs them.

1.0.0: adds the Hazelchat chat to every public page with one installation code; works with Klaro!; optional wait for your consent manager; English and German.

Drupal is a registered trademark of Dries Buytaert. Hazelchat is not affiliated with or endorsed by Dries Buytaert or the Drupal Association; the name is used here only to say which software the module works with.

Let your Drupal site answer from its own pages.

Questions? Email hello@hazelchat.co. We answer within one business day. Not on Drupal? See all the ways to install Hazelchat. Other guides: add an AI chat agent to any website and cookie banners.