Skip to content

Instantly share code, notes, and snippets.

var error = new Error("The error message");
error.stack = "Error: The error message\n at HTMLButtonElement.<anonymous> (http://localhost:8080/dist/main.js:22:39141)\n at HTMLButtonElement.o (http://localhost:8080/dist/main.js:22:18397)";
console.log(error.stack);
Raven.captureException(error);
import requests
url = "https://sentry.io/api/0/projects/<ORG_SLUG_HERE>/<PROJECT_SLUG_HERE>/rules/"
payload = "{\"environment\":null,\"actionMatch\":\"all\",\"frequency\":\"30\",\"name\":\"API Alert Example\",\"conditions\":[{\"name\":\"An event is first seen\",\"id\":\"sentry.rules.conditions.first_seen_event.FirstSeenEventCondition\"},\n{\"interval\":\"1h\",\"name\":\"An event is seen more than 50 times in 1h\",\"value\":50,\"id\":\"sentry.rules.conditions.event_frequency.EventFrequencyCondition\"}],\"id\":\"412675\",\"actions\":[{\"name\":\"Send a notification (for all legacy integrations)\",\"id\":\"sentry.rules.actions.notify_event.NotifyEventAction\"},{\"channel_id\":\"CA6MX2DE2\",\"name\":\"Send a notification to the vu Slack workspace to #ember-errors and show tags [] in notification\",\"workspace\":\"1305\",\"tags\":\"\",\"id\":\"sentry.integrations.slack.notify_action.SlackNotifyServiceAction\",\"channel\":\"#ember-errors\"}]}"
headers = {
'Content-Type': "application/json",
'Authorization
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Vanilla JS</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Sentry JS SDK 2.1.+ required -->
<script src="https://cdn.ravenjs.com/3.20.0/raven.min.js"></script>
<script>
from raven import Client
client = Client('YOUR DSN')
try:
1 / 0
except ZeroDivisionError:
client.captureException(fingerprint=['CUSTOM', 'FINGERPRINT'])
# REPLACE <ISSUE_ID>
# REPLACE <AUTH_TOKEN>
require 'uri'
require 'net/http'
url = URI("https://sentry.io/api/0/issues/<ISSUE_ID>/tags/user/")
http = Net::HTTP.new(url.host, url.port)
// DESCRIPTION:
// This script will execute three API calls to Sentry:
// 1. Create a new user and add the user to a team.
// 2. Create a new project.
// 3. Retrieve the project's client key (ie. DSN).
////////////////////////////////////////////////////////////////////////////////////////////////////////
// INSTRUCTIONS:
// 1. Update <ORG_SLUG>, <TEAM_SLUG>, and <PROJECT_SLUG> with real Slug values from your Sentry account.
// 2. Update <EMAIL_ADDRESS> with a real email address
// 3. Update <AUTH_TOKEN> with your Sentry API TOKEN
# Token (SENTRY_AUTH_TOKEN) must have appropriate priveleges (i.e. project:write, etc.)
# You will get 401 Unauthorized (RestClient::Unauthorized) if auth token does not appropriate permissions.
# Usage: SENTRY_AUTH_TOKEN=<YOUR_SENTRY_AUTH_TOKEN> SENTRY_ORG_SLUG=<YOUR_SENTRY_ORG_SLUG>
# SENTRY API DOCS https://docs.sentry.io/api/
import requests
import json
import os
base_url="https://sentry.io"
<!-- Begin Call Tracking Code -->
<!-- Omit http from path to ensure protocol is same as current request -->
<script src="//cdn.invoca.solutions/optimizely/optimizely-1.0.js"></script>
<script src="//solutions.invocacdn.com/js/pnapi_integration-latest.min.js" type="text/javascript"></script>
<script type="text/javascript">
//Grab Google Analytics Visitor ID
function getClientId() {
// If ga is defined, check for the clientId and return it
if (typeof ga !== 'undefined' && typeof ga.getAll === 'function') {
<script src="http://cdn.invoca.solutions/optimizely/optimizely-1.0.js"></script>
<script src="//js4.invoca.net/4/integration.js"></script>
<script type="text/javascript">
Invoca.advertiser_integration = {
id : '46211',
campaignId : 64762,
ringPoolId : 23336,
numberSelector: '.phone_number',
poolParams : {variation_ids : getVariationsInParameters()}
};