1.7.12 • Published 3 days ago

@jill64/sentry-sveltekit-cloudflare v1.7.12

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days ago

@jill64/sentry-sveltekit-cloudflare

♟️ Unofficial Sentry Integration for SvelteKit Cloudflare Adapter

Workaround until close @sentry/javascript #8291.

!NOTE If you are looking for other node-less adapters, see sentry-sveltkeit-edge.

Installation

npm i @jill64/sentry-sveltekit-cloudflare

Configuration

Add the following settings to your SvelteKit application's vite.config.js.

// vite.config.js
import { sveltekit } from '@sveltejs/kit/vite'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [sveltekit()],
  ssr: {
    noExternal: ['@jill64/sentry-sveltekit-cloudflare']
  }
  // ...
})

Usage

Client

// hooks.client.js
import { init } from '@jill64/sentry-sveltekit-cloudflare/client'
// or
// import { clientInit } from '@jill64/sentry-sveltekit-cloudflare'

const onError = init(
  '__YOUR_SENTRY_DSN__'
  // ,
  // {
  //   sentryOptions: {
  //     // ... Other Sentry Config
  //   },
  //   enableInDevMode: boolean (default: false)
  // }
)

export const handleError = onError((e, sentryEventId) => {
  // Your Error Handler
})

Server

// hooks.server.js
import { init } from '@jill64/sentry-sveltekit-cloudflare/server'
// or
// import { serverInit } from '@jill64/sentry-sveltekit-cloudflare'

const { onHandle, onError } = init(
  '__YOUR_SENTRY_DSN__'
  // ,
  // {
  //   toucanOptions: {
  //     // ... Other Sentry Config
  //   },
  //   handleOptions: {
  //     handleUnknownRoutes: boolean (default: false)
  //   },
  //   enableInDevMode: boolean (default: false)
  // }
)

export const handle = onHandle(({ event, resolve }) => {
  // Your Handle Code
})

export const handleError = onError((e, sentryEventId) => {
  // Your Error Handler
})

Configure Source Map (Optional)

Use @sentry/vite-plugin.

Example

// vite.config.js
import { sentryVitePlugin } from '@sentry/vite-plugin'
import { sveltekit } from '@sveltejs/kit/vite'
import { defineConfig } from 'vite'

export default defineConfig({
  build: {
    sourcemap: true
  },
  plugins: [
    sentryVitePlugin({
      org: process.env.SENTRY_ORG,
      project: process.env.SENTRY_PROJECT,
      authToken: process.env.SENTRY_AUTH_TOKEN
    }),
    sveltekit()
  ]
})

License

MIT

1.7.12

3 days ago

1.7.11

20 days ago

1.7.10

1 month ago

1.7.9

1 month ago

1.7.8

2 months ago

1.7.7

2 months ago

1.7.6

3 months ago

1.7.5

3 months ago

1.7.4

3 months ago

1.7.3

4 months ago

1.7.2

4 months ago

1.7.1

4 months ago

1.7.0

5 months ago

1.6.2

5 months ago

1.6.1

5 months ago

1.6.0

5 months ago

1.5.0

5 months ago

1.4.2

5 months ago

1.4.1

5 months ago

1.4.0

5 months ago

1.3.3

6 months ago

1.3.2

6 months ago

1.3.1

6 months ago

1.3.0

6 months ago

1.2.0

6 months ago

1.1.0

6 months ago

1.0.0

7 months ago

0.6.0

7 months ago

0.5.0

7 months ago

0.4.32

7 months ago

0.4.31

7 months ago

0.4.30

7 months ago

0.4.29

7 months ago

0.4.28

7 months ago

0.4.27

7 months ago

0.4.26

7 months ago

0.4.25

7 months ago

0.4.24

7 months ago

0.4.23

7 months ago

0.4.22

7 months ago

0.4.21

7 months ago

0.4.20

7 months ago

0.4.19

7 months ago

0.4.18

7 months ago

0.4.17

7 months ago

0.4.16

7 months ago

0.4.15

7 months ago

0.4.14

7 months ago

0.4.13

7 months ago

0.4.12

7 months ago

0.4.11

7 months ago

0.4.10

7 months ago

0.4.9

7 months ago

0.4.8

8 months ago

0.4.5

8 months ago

0.4.3

8 months ago

0.4.2

8 months ago

0.4.1

8 months ago

0.4.0

8 months ago

0.3.0

8 months ago

0.2.0

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago