Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/svelte-playground/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_HAWK_TOKEN=your_integration_token_here
20 changes: 20 additions & 0 deletions packages/svelte-playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Test playground for Hawk Error Tracker integration with SvelteKit and Svelte.
## Table of Contents

- [Getting Started](#getting-started)
- [Hawk Integration](#hawk-integration)

## Getting Started

Expand All @@ -21,3 +22,22 @@ yarn install
```shell
yarn dev
```

## Hawk Integration

Current integration in `hooks.client.ts`:

```typescript
import Hawk from '@hawk.so/javascript';

if (import.meta.env.VITE_HAWK_TOKEN) {
new Hawk({
token: import.meta.env.VITE_HAWK_TOKEN
});
}
```

Hawk automatically registers global error handlers for:

- `window.onerror`
- `window.onunhandledrejection`
7 changes: 7 additions & 0 deletions packages/svelte-playground/src/hooks.client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Hawk from '@hawk.so/svelte';

if (import.meta.env.VITE_HAWK_TOKEN) {
new Hawk({
token: import.meta.env.VITE_HAWK_TOKEN,
});
}
Loading