Timill Platform Documentation

Scripting

Timill Platform's scripting environments — JavaScript backend scripts, scripted widgets, and scripted charts.

Timill Platform provides four powerful scripting environments for customization and automation, each designed for different use cases and user skill levels.

Scripting Environments at a Glance#

EnvironmentLanguageWho Uses ItRuntimeSandboxed
Scripted ChartsJavaScript (Goja ES5.1)End users — via UIBrowser + BackendYes
Scripted WidgetsGo Templates (html/template)End users — via UIBackendYes
Backend ScriptsGoja / GonjaAdmins — event-driven automationBackend VM poolYes
Custom Widgets SDKGo + templDevelopers — compiled widgetsBackend (compiled)N/A

When to Use Each Environment#

Scripted Charts#

Create dynamic data visualizations using Apache ECharts.

Best For

  • Status distribution charts
  • User workload bars
  • Priority scatter plots
  • Any chart that needs real-time data

Example: Create a pie chart showing item status distribution — all via the UI, no coding required.

See: Scripted Charts Guide

Scripted Widgets#

Build custom HTML widgets using Go’s html/template syntax with built-in query helpers.

Best For

  • Item lists with custom filters
  • Status dashboards
  • Recent activity feeds
  • Widgets that need RBAC enforcement

Example: Create a widget showing open tasks for a specific user — rendered server-side with full access control.

See: Scripted Widgets Guide

Backend Scripts#

Run server-side automation scripts triggered by events or schedules.

Best For

  • Complex business logic
  • Cross-group operations
  • External API integrations
  • Scheduled maintenance tasks

Supported languages:

  • JavaScript (via Goja VM)
  • Go Templates (via Gonja — Jinja2-compatible)

See: Backend Scripts Guide

Custom Widgets SDK#

Build compiled custom widgets using Go and the templ template engine — the same technology used by built-in widgets.

Best For

  • High-performance widgets
  • Complex data transformations
  • Widgets requiring custom Go logic
  • Reusable widget libraries

Example: Create a burndown chart with custom calculation logic.

See: Custom Widgets SDK Documentation

JavaScript API Reference#

All JavaScript-based scripts (charts, some backend scripts) share a common API:

ObjectPurpose
userIdCurrent user ID
groupIdGroup ID (if group-scoped)
userUser profile and operations
groupGroup operations and data access
itemCurrent item (if item-scoped)
apiData transformation helpers
echartsChart configuration helpers

See: API Reference

Security Model#

All scripting environments are sandboxed with the following security features:

FeatureChartsWidgetsBackend Scripts
RBAC Enforcement
Script Timeout10s30s60s
API Call LimitYesYesYes
SSRF ProtectionYesYesYes
No File System Access
No Network (except fetch)✅ (rate limited)

Ready-to-use examples for each scripting type:

Next Steps#

  1. For end users: Start with Scripted Charts or Scripted Widgets
  2. For admins: Learn Backend Scripts for automation
  3. For developers: Explore the Custom Widgets SDK