Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@jill64/sentry-sveltekit-edge
Advanced tools
♟️ Unofficial Sentry integration for SvelteKit edge runtime
♟️ Unofficial Sentry integration for SvelteKit edge runtime
npm i @jill64/sentry-sveltekit-edge
fetch
[!NOTE] If running on
Cloudflare Pages
, use instead@jill64/sentry-sveltekit-cloudflare
.
This library is @sentry/sveltekit
without the node runtime dependencies.
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-edge']
}
// ...
})
// hooks.client.js
import { init } from '@jill64/sentry-sveltekit-edge/client'
// or
// import { clientInit } from '@jill64/sentry-sveltekit-edge'
const onError = init(
'__YOUR_SENTRY_DSN__'
// ,
// {
// sentryOptions: {
// // ... Other Sentry Config
// },
// enableInDevMode: boolean (default: false)
// }
)
export const handleError = onError((e) => {
// Your Error Handler
})
// hooks.server.js
import { init } from '@jill64/sentry-sveltekit-edge/server'
// or
// import { serverInit } from '@jill64/sentry-sveltekit-edge'
const { onHandle, onError } = serverInit(
'__YOUR_SENTRY_DSN__'
// ,
// {
// sentryOptions?: {
// // ... Other Sentry Config (Based on NodeOptions)
// },
// handleOptions?: {
// handleUnknownRoutes: boolean (default: false)
// },
// enableInDevMode?: boolean (default: false)
// }
)
export const handle = onHandle(({ event, resolve }) => {
// Your Handle Code
})
export const handleError = onError((e) => {
// Your Error Handler
})
Use @sentry/vite-plugin.
// 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()
]
})
FAQs
♟️ Unofficial Sentry integration for SvelteKit edge runtime
The npm package @jill64/sentry-sveltekit-edge receives a total of 130 weekly downloads. As such, @jill64/sentry-sveltekit-edge popularity was classified as not popular.
We found that @jill64/sentry-sveltekit-edge demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.