diff --git a/edge-apps/tfl-bus-status/index.html b/edge-apps/tfl-bus-status/index.html index 5c7eccf2..be36dc35 100644 --- a/edge-apps/tfl-bus-status/index.html +++ b/edge-apps/tfl-bus-status/index.html @@ -68,7 +68,7 @@

+ - \ No newline at end of file diff --git a/edge-apps/tfl-bus-status/screenly.yml b/edge-apps/tfl-bus-status/screenly.yml index cc902f6a..0346fb7f 100644 --- a/edge-apps/tfl-bus-status/screenly.yml +++ b/edge-apps/tfl-bus-status/screenly.yml @@ -24,3 +24,9 @@ settings: help_text: | You can find your bus stop here: https://playground.srly.io/edge-apps/helpers/tfl/bus-stop-lookup/ + sentry_dsn: + type: secret + title: Sentry Client Key + optional: true + is_global: true + help_text: Sentry Client Key from Sentry SDK for error capturing. \ No newline at end of file diff --git a/edge-apps/tfl-bus-status/static/js/script.js b/edge-apps/tfl-bus-status/static/js/script.js index 0c8402d0..6c013871 100644 --- a/edge-apps/tfl-bus-status/static/js/script.js +++ b/edge-apps/tfl-bus-status/static/js/script.js @@ -1,8 +1,18 @@ -/* global screenly */ +/* global screenly, Sentry */ const apiUrl = 'https://api.tfl.gov.uk/' // Base URL for the TfL API const stopId = screenly.settings.stop_id const apiKey = screenly.settings.tfl_api_token +const sentryDsn = screenly.settings.sentry_dsn + +// Initiate Sentry. +if (sentryDsn) { + Sentry.init({ + dsn: sentryDsn + }) +} else { + console.warn('Sentry DSN is not defined. Sentry will not be initialized.') +} async function getCachedData (url, cacheKey) { const cachedData = JSON.parse(localStorage.getItem(cacheKey)) @@ -227,7 +237,6 @@ async function fetchBusData () { busArrival.innerHTML = error document.querySelector('.bus-list').classList.add('hidden') } - // Send signal to load the screen once content is ready. screenly.signalReadyForRendering() }