How to capture text message in vanilla javascript

Viewed 103

Goal:
Capture data in frontend with help of javascript with the hardcoded text message "testtest".
There is a similiar aproach for C# and the code is "ravenClient.Capture(new SentryEvent("testtest"));"

Problem:
I cannot find a solution for javascript that is similiar approach for c# code "ravenClient.Capture(new SentryEvent("testtest"));"
I cannot find information about it at Docs "https://docs.sentry.io/platforms/javascript/".
Any idea about how to do it?

Info:
*Using bootstrap, jquery, vanilla javascript
*I'm newbie in Sentry

Thank you!

1 Answers

In both the .NET and the JavaScript SDKs you can call captureMessage.

C#

SentrySdk.CaptureMessage("testtest");

Documented here

JavaScript

Sentry.captureMessage("testtest")'

Here for JavaScript.

Please note the Raven SDKs were discontinued two years ago.

To install the new .NET SDK you can see these docs.

Creating a new project in Sentry will give you a wizard with steps to set things up for the selected technology.

Related