Skip to content

Testing an integration #6826

Answered by Lilja
Lilja asked this question in Q&A
Jan 17, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Don't forget dsn!

This worked for me:

function getDefaultNodeClientOptions(
  options: Partial<NodeClientOptions> = {}
): NodeClientOptions {
  return {
    integrations: [new PinoSentry(logger)],
    transport: () =>
      createTransport({ recordDroppedEvent: () => undefined }, (_) =>
        resolvedSyncPromise({})
      ),
    stackParser: () => [],
    instrumenter: "sentry",
    ...options,
  };
}

let breadcrumbs: null | Breadcrumb[] = null;
const options = getDefaultNodeClientOptions({
  beforeSend: (event) => {
    if (event.breadcrumbs) {
      breadcrumbs = event.breadcrumbs;
    }
    return null;
  },
  dsn: SENTRY_DSN,
});
const client = new NodeClient(options);
const hub = new

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@AbhiPrasad
Comment options

@Lilja
Comment options

Answer selected by Lilja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants