Skip to content

Instantly share code, notes, and snippets.

@mcdougal
mcdougal / _error.js
Created Sep 28, 2018
Using @sentry/browser with Next.js for client and server-side rendering
View _error.js
import * as Sentry from '@sentry/browser';
import getConfig from 'next/config';
import React from 'react';
const { SENTRY_DSN } = getConfig().publicRuntimeConfig;
Sentry.init({ dsn: SENTRY_DSN });
/**
* Send an error event to Sentry.