getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.97k stars 1.57k forks source link

why my own 'transport` is not getting the regular `transportOptions` object? #1822

Closed zivl closed 5 years ago

zivl commented 5 years ago

In the following file: https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/backend.ts#L146

It seems like if I initialise Sentry with my own transport, I don't get the default transportOptions: e.g. Sentry.init({ transport: (options) => {}, ... })

HazAT commented 5 years ago

Hmm not sure, but we do pass in the options: https://github.com/getsentry/sentry-javascript/blob/c56f9a180a5890a02cd26884df8ec35f74895491/packages/browser/src/backend.ts#L57

zivl commented 5 years ago

you may see the reproduce here: https://github.com/wix/sentry-testkit/blob/master/index.js#L10 if you will try to print the options you'll see only the dsn parameter, while TransportOptions is a bit richer as you can see here: https://github.com/getsentry/sentry-javascript/blob/master/packages/types/src/index.ts#L227

According to the code on ./packages/browser/src/backend.ts, it looks like that if I config a transport then I have to provide transportOptions as well

kamilogorek commented 5 years ago

Closing due to the issue getting out-dated. Feel free to ping me to reopen it if it's still relevant.