Embed the Clanker Support AI support agent in any Python web app — one helper that renders the widget script tag, escaped and framework-friendly.
Project description
clankersupport
Embed the Clanker Support AI-powered support agent in any Python web app. One helper renders the widget <script> tag — escaped, validated, and framework-friendly — so visitors get streaming answers from your knowledge base, human escalation, and operator replies, with zero backend work in your app.
pip install clankersupport
Quick start
Grab your project's public key from the dashboard (Project → Embed), then render the tag into your base template:
from clankersupport import script_tag
tag = script_tag("pk_your_project_key")
# <script src="https://api.clankersupport.com/widget.js" data-project="pk_your_project_key" data-api="https://api.clankersupport.com" async></script>
The return value implements the __html__ protocol, so Jinja2 renders it unescaped automatically — no | safe needed.
The public key is safe to expose — it's the same key the plain
<script>embed uses.
FastAPI + Jinja2
from clankersupport import script_tag
from fastapi.templating import Jinja2Templates
templates = Jinja2Templates(directory="templates")
templates.env.globals["clanker_support"] = lambda: script_tag("pk_your_project_key")
<!-- templates/base.html -->
<body>
{% block content %}{% endblock %}
{{ clanker_support() }}
</body>
Flask
from clankersupport import script_tag
app.jinja_env.globals["clanker_support"] = lambda: script_tag("pk_your_project_key")
Django
Django templates don't use the __html__ protocol; mark the tag safe explicitly:
from clankersupport import script_tag
from django.utils.safestring import mark_safe
def support_widget(request):
return {"clanker_support": mark_safe(script_tag("pk_your_project_key"))}
Options
script_tag(
"pk_your_project_key",
api_url="https://support-api.your-domain.com", # self-hosted API origin
brand_color="#4f46e5", # launcher/header accent
mode="bubble", # "bubble" (default) | "inline"
theme="auto", # "light" (default) | "dark" | "auto"
escalation_threshold=3, # messages before "Talk to a human"
)
Invalid values (empty key, unknown mode/theme, non-positive threshold) raise ValueError at render time, so misconfiguration fails in development instead of silently shipping a broken widget.
Self-hosting
Clanker Support is open source (theopenco/llmchat). Point api_url at your own deployment; the tag's src and data-api both follow it.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clankersupport-1.0.0.tar.gz.
File metadata
- Download URL: clankersupport-1.0.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f769966c78b93ef48c35973633051b0ad6be109f667fe56b6bc293d2f6c2d8f
|
|
| MD5 |
268d07ecff1e20da31a04e43312e0c8b
|
|
| BLAKE2b-256 |
651bbdfdf2a9bb15009d8bb407f12cb52e6640a05f59ce9eccc5c553e3b72801
|
File details
Details for the file clankersupport-1.0.0-py3-none-any.whl.
File metadata
- Download URL: clankersupport-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03ea02b42713e2eee875004dca7d7701fa4f34615799db9db875d50922517366
|
|
| MD5 |
be89d0cf75d1e694374780ffd444578a
|
|
| BLAKE2b-256 |
473fe61c6d7dfbc3714389d72d53436e4642705d5e5ab382467aadcc8e1ddc89
|