getsentry / sentry-laravel

The official Laravel SDK for Sentry (sentry.io)
https://sentry.io
MIT License
1.26k stars 189 forks source link

Install an JavaScript SDK during `sentry:publish` #646

Closed cleptric closed 1 year ago

cleptric commented 1 year ago

Laravel offers two starter kits, Breeze and Jetstream with optionally bootstrap an application with JavaScript frameworks like Vue.js or React (with Interia.js) or Livewire.

The focus is on frontend error reporting, performance monitoring might be added in the future.

Vue.js snippet

import * as Sentry from "@sentry/vue";
import { BrowserTracing } from "@sentry/tracing";

Sentry.init({
  app,
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: [new BrowserTracing()],
});

React snippet

import * as Sentry from "@sentry/react";
import { BrowserTracing } from "@sentry/tracing";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: [new BrowserTracing()],
});

Livewire snippet

// TBD
ankurk91 commented 1 year ago

The DSN must be loaded via .env file