Docs Developers Status ForumSpark Hub
Build · Script injection

Script Injection

Script extensions inject JavaScript and CSS directly into forum pages. Combined with the ForumSpark JavaScript SDK, they can add rich interactive features.

Package structure

{
    "name": "Analytics Tracker",
    "description": "Add analytics tracking to your forum.",
    "js": "document.addEventListener('forumspark:init', () => { console.log('Tracking active'); });",
    "css": ".analytics-badge { display: none; }",
    "inject_location": "head"
}

Injection locations

LocationDescription
headInjected inside <head>, ideal for analytics, meta tags, and early CSS
top_of_pageAfter the body opens, before the forum layout, for banners and global components
after_the_boardAfter the forum content, for footer scripts and deferred loading

Security requirements

Packages are automatically scanned for dangerous patterns. Avoid these in your code:

SeverityFlagged Patterns
Higheval(), Function(), document.cookie
Mediumfetch(), XMLHttpRequest, window.location, WebSocket, navigator.sendBeacon, importScripts
Lowatob(), btoa(), external CSS url()

High-severity flags will block approval. Medium flags require justification during review.

Field reference

FieldTypeRequiredDescription
namestringYesExtension name (max 255 chars)
descriptionstringNoShort description (max 1000 chars)
jsstringNo*JavaScript code
cssstringNo*CSS styles
inject_locationstringYesOne of: head, top_of_page, after_the_board

* At least one of js or css must be provided.