MkDocs’s extra_javascript list does not support setting arbitrary HTML attributes like async or data-* on injected script tags. The two reliable approaches are: override the theme’s main.html block to paste the full script tag, or use a small shim JS file that injects the widget script programmatically.
MkDocs Material’s extra_javascript supports an object form ({path: "...", defer: true}) but does not expose data-* attributes directly, which is why the template override or JS shim approaches above are required for the BeforeQuery widget.
Get your keys — your knowledge base ID and public client key (bq_pk_...) are in the BeforeQuery dashboard under Knowledge Base → Integration. Add your MkDocs site’s domain to the key’s origin allowlist.
For all widget configuration options, see Widget reference.