Files
TREK/plugin-sdk/examples/trip-countdown
mauriceboe 29c2979da4 fix(plugins): trips.getById returns the actual trip row, not the access check
canAccessTrip only returns { id, user_id } (it's a membership check), but the
rpc-host's trips.getById returned it verbatim — so plugins saw a trip with no
title/start_date/etc. Fetch the real row after the access check. Also fix the
reference plugin to read t.title (the trips column is 'title', not 'name').
2026-07-04 19:11:23 +02:00
..

Trip Countdown

A dashboard widget that counts down the days to your next trip.

Trip Countdown widget on the dashboard

What it does

Trip Countdown adds a small dashboard widget showing how many days remain until your upcoming trip starts. When a trip is under way it shows "in progress" instead. It's the reference plugin for the TREK plugin system — a minimal but complete widget that reads trip data through the sandbox and renders it in an isolated iframe.

Screenshots

The widget counting down to a trip

Permissions

Permission Why this plugin needs it
db:read:trips To read the current trip's start date so it can compute the countdown. The read is membership-checked by TREK, so the widget only ever sees a trip you already have access to.

It requests no network access and stores no data of its own.

Setup

None. Enable plugins on your instance (TREK_PLUGINS_ENABLED=true), install and activate Trip Countdown, and the widget appears on your dashboard.

Building

The widget ships plain JS/HTML — no build step. server/index.js is the plugin entry; client/index.html is the widget iframe.

License

MIT — see the TREK repository.