Add Coursefinch to Drupal
There is no Drupal module yet. You add the script to your theme as a library, which is a small change for whoever looks after your theme.
A button on every page
- In your theme's THEMENAME.libraries.yml, add a library that loads the script from our server:
coursefinch: js: https://app.coursefinch.co.uk/widget/coursefinch.js: { type: external, attributes: { defer: true, data-coursefinch-launcher: your-college } } - In your theme's THEMENAME.info.yml, add this line to the libraries: list, so it loads on every page. If the file has no libraries: list, add one above it.
- THEMENAME/coursefinch - Clear the cache so Drupal picks up the change.
A box on one page
- Placing the box inside a page depends on your theme and text formats. Ask us and we will help your team with it.
Content Security Policy
If your website sets a Content Security Policy, allow these.
| Directive | Value to add |
|---|---|
| script-src | https://app.coursefinch.co.uk https://challenges.cloudflare.com |
| connect-src | https://app.coursefinch.co.uk |
| frame-src | https://challenges.cloudflare.com |
| font-src | https://app.coursefinch.co.uk |
Check it is working
- Open a page of your website in a private browser window. The button appears in the bottom corner.
- Select it and ask a question about your college.
- If nothing appears, open the browser console. A Content Security Policy error means an entry above is missing.
- If your website combines, delays or moves scripts to make pages faster, leave this one out of that.
Sources
- Drupal.org, Adding assets (CSS, JS) to a Drupal theme via *.libraries.yml (read 25 November 2026)