Documentation Index
Fetch the complete documentation index at: https://docs.hacktionbase.com/llms.txt
Use this file to discover all available pages before exploring further.
Hacktionbase.init(config)
Initializes the SDK, fetches widget configuration from the server, and mounts the chat bubble and iframe on the page.
Parameters
Configuration object.
Your SDK key from Settings → Widget in the dashboard.
Your tenant slug (the subdomain used to identify your workspace).
position
string
default:"bottom-right"
Widget position: 'bottom-right' or 'bottom-left'.
offset
object
default:"{ x: 20, y: 20 }"
Pixel offset from the corner. { x: number, y: number }.
If true, the widget bubble is hidden on load. Use Hacktionbase.show() to reveal it later.
Environment tag attached to all events: 'prod' or 'staging'.
Example
Hacktionbase.init({
sdkKey: 'sk_live_abc123',
tenant: 'acme',
position: 'bottom-left',
offset: { x: 16, y: 16 },
hidden: false
});
Behavior
- Calling
init twice without calling destroy() first logs a warning and does nothing.
- If
sdkKey or tenant is missing, the SDK logs an error and does not mount.
- If the document is still loading, mounting is deferred until
DOMContentLoaded.
Pre-queue pattern
You can set configuration on the global Hacktionbase object before the script loads. The SDK will auto-initialize when it detects a queued config:
<script>
window.Hacktionbase = {
sdkKey: 'sk_live_abc123',
tenant: 'acme'
};
</script>
<script src="https://s3.eu-west-3.amazonaws.com/hacktionbase.sdk/latest/hacktionbase.js" async></script>