File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
packages/svelte-playground Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ VITE_HAWK_TOKEN = your_integration_token_here
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Test playground for Hawk Error Tracker integration with SvelteKit and Svelte.
55## Table of Contents
66
77- [ Getting Started] ( #getting-started )
8+ - [ Hawk Integration] ( #hawk-integration )
89
910## Getting Started
1011
@@ -21,3 +22,22 @@ yarn install
2122``` shell
2223yarn dev
2324```
25+
26+ ## Hawk Integration
27+
28+ Current integration in ` hooks.client.ts ` :
29+
30+ ``` typescript
31+ import Hawk from ' @hawk.so/javascript' ;
32+
33+ if (import .meta .env .VITE_HAWK_TOKEN ) {
34+ new Hawk ({
35+ token: import .meta .env .VITE_HAWK_TOKEN
36+ });
37+ }
38+ ```
39+
40+ Hawk automatically registers global error handlers for:
41+
42+ - ` window.onerror `
43+ - ` window.onunhandledrejection `
Original file line number Diff line number Diff line change 1+ import Hawk from '@hawk.so/svelte' ;
2+
3+ if ( import . meta. env . VITE_HAWK_TOKEN ) {
4+ new Hawk ( {
5+ token : import . meta. env . VITE_HAWK_TOKEN ,
6+ } ) ;
7+ }
You can’t perform that action at this time.
0 commit comments