Join the Discussion on Sentry's Streamlined SDKs

Daniel Griesser /

If you use Sentry, you’re probably familiar with our SDKs. While they aren’t the only reason for Sentry’s success, they do play a very important role, from the first time an error is thrown to the moment you fix the bug.

SDKs are often like political figures (editor’s note: there are so many things we resisted saying here) — you don’t notice them if they do a good job. Jokes aside, there are very few expectations for an SDK. SDKs should do what they’re supposed to do without taking up too much of your time, so you can focus on stuff that really matters, like improving your product or voting for people who aren’t idiots.

With this in mind, we decided to rethink and streamline our SDK experience on all levels. We introduced a new concept called Scopes, which manages our context handling and works the same across all new SDKs. We defined a baseline of options that function the same no matter which integration you’re using.

In short, we don’t want switching between different platforms to feel like you’re switching between different SDKs. Everything should feel the same across Sentry. Which is why we’re now officially making many of our new SDKs available for technical preview.

Unified API

A product usually consists of many moving parts across different platforms. One of Sentry’s strengths is our support for a multitude of platforms and programming languages. Many organizations that initially used Sentry for their frontend application, now also use it for their backend and/or mobile apps.

To illustrate what we’re doing, let’s take look at the JavaScript SDK, keeping in mind that this example could apply to any other language.

The first and most important step is to initialize the SDK:

init({dsn: 'YOUR DSN GOES HERE'});

Theoretically, you could stop here. Sentry would catch all of your errors and send them to your account, proving the info that you’d need to take action.

While this probably already covers most use cases, there are users who incorporate Sentry into their toolchain who also use it for more advanced features, like adding breadcrumbs, tags or extra.

Adding a breadcrumb or capturing a custom error is as simple as:

addBreadcrumb({
 type: 'ui.click',
 message: 'User clicked on Button X' 
});
// OR
try {
 dangerousFunction();
catch (error) {
 captureException(error);
}

While this is only a tiny fraction of what you can do with the streamlined SDKs, under the hood, they are more powerful and work in a more logical way than before. We have more hooks and callbacks as well as simpler extension methods for you to harness the full potential of Sentry.

All our new SDKs (which include .NET / C#, Python, Node, Electron, Cordova, Rust, and Browser) are built from the ground up with this common goal in mind. They each provide the same functions and are set up in the same way, with the exception of being idiomatic to the differences between ecosystems.

Wait, there’s more.

This blog post is merely here to make you aware of the new SDKs. Now that you are aware, keep an eye out for future posts that highlight the advantages you’ll gain by switching over to the new system. Of course, we’ll still provide support for all old SDKs, but we wanted to have a stable foundation to build upon for all upcoming features we’re planning for Sentry.

To learn more, please join the Sentry forum where you’ll find:

  • Our Unified SDK API spec
  • Sub-forums specific to Python, .NET, and JavaScript
  • Opportunities to engage in discussion with our SDK team

We’re very excited about our new SDKs, and we’re looking forward to your feedback!