UNPKG

@upbond/customauth

Version:

CustomAuth login with torus to get user private key

25 lines (20 loc) 542 B
import type { Transaction, TransactionContext } from "@sentry/types"; export interface Sentry { startTransaction(_: TransactionContext): Transaction; } export default class SentryHandler { sentry: Sentry | null = null; constructor(sentry?: Sentry) { this.sentry = sentry; } startTransaction(context: TransactionContext): Transaction | void { if (this.sentry) { return this.sentry.startTransaction(context); } } finishTransaction(tx: void | Transaction): void { if (tx) { tx.finish(); } } }