Last active
January 6, 2023 10:50
-
-
Save floehopper/1d0d1c50c7fa31b143dea46b66eaec66 to your computer and use it in GitHub Desktop.
Revisions
-
floehopper revised this gist
Sep 19, 2022 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,11 +4,8 @@ "scripts": { "dev": "svelte-kit dev", "build": "export VITE_LATEST_SHA=`git rev-parse HEAD` && svelte-kit build", }, "dependencies": { "rollbar": "^2.24.1", }, } -
floehopper revised this gist
Sep 19, 2022 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,5 +6,9 @@ "build": "export VITE_LATEST_SHA=`git rev-parse HEAD` && svelte-kit build", // ... }, "dependencies": { "rollbar": "^2.24.1", // ... }, // ... } -
floehopper created this gist
Sep 19, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ <script> /* eslint-disable */ import { mode } from "$app/env"; import { onMount } from "svelte"; const rollbarAccessToken = import.meta.env .VITE_ROLLBAR_POST_CLIENT_ITEM_ACCESS_TOKEN; const codeVersion = import.meta.env.VITE_LATEST_SHA; onMount(() => { let _rollbarConfig = { accessToken: rollbarAccessToken, captureUncaught: true, captureUnhandledRejections: true, payload: { environment: mode, client: { javascript: { code_version: codeVersion, source_map_enabled: true, guess_uncaught_frames: true, }, }, }, }; // Insert Rollbar snippet here }); </script> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ import "dotenv/config"; import Rollbar from "rollbar"; import { dev, mode } from "$app/env"; const rollbar = new Rollbar({ accessToken: process.env.ROLLBAR_POST_SERVER_ITEM_ACCESS_TOKEN, payload: { environment: mode, }, }); /** @type {import('@sveltejs/kit').HandleError} */ export async function handleError({ error, event }) { const headers = {}; event.request.headers.forEach((v, k) => (headers[k] = v)); if (!dev) rollbar.error(error, { headers: headers, url: event.url, method: event.request.method, }); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ { "name": "myapp", "version": "0.0.1", "scripts": { "dev": "svelte-kit dev", "build": "export VITE_LATEST_SHA=`git rev-parse HEAD` && svelte-kit build", // ... }, // ... }