App data
App data lets a service you run feed live values into boards that installed your app, and lets template add-ons render them. Your code runs on your servers; the board only ever stores and displays data.
The app token
When a board installs your app, ForumSpark issues that installation its own app data token, shown to the board admin on your extension's page in their admin panel. The admin gives it to your service. The token can only read and write your app's own namespace on that one board, is revoked automatically on uninstall, and can be regenerated by the admin at any time.
The API
Authenticate with the token as a Bearer token against the board's API:
PUT https://theirboard.forumspark.net/api/v1/app-data/online_count
Authorization: Bearer {app data token}
Content-Type: application/json
{ "value": 42 }
Endpoints: GET /app-data lists your keys, GET /app-data/{key} reads one, PUT /app-data/{key} writes one, DELETE /app-data/{key} removes one, and PUT /app-data with a values object writes up to 20 keys in one call. Values are arbitrary JSON. Limits: keys are letters, numbers, underscores and hyphens up to 100 characters; values up to 64KB of JSON; 50 keys per app per board.
Rendering in templates
Every stored value is available to Custom Templates and template add-ons under app_data.{your_slug}.{key}, with hyphens in your slug becoming underscores:
{{#if app_data.discord_bridge.online_count}}
<div><b>{{ app_data.discord_bridge.online_count }}</b> online on Discord</div>
{{/if}}
{{#each app_data.discord_bridge.online_members}}
<span>{{ this.value }}</span>
{{/each}}
Values are escaped like every template variable, missing keys render as empty, and the board admin can inspect or clear everything you stored from their admin panel.