()
| 274 | * Closes the SDK, stops sending events. |
| 275 | */ |
| 276 | export async function close(): Promise<void> { |
| 277 | try { |
| 278 | const client = getClient(); |
| 279 | |
| 280 | if (client) { |
| 281 | await client.close(); |
| 282 | } |
| 283 | } catch (e) { |
| 284 | debug.error('Failed to close the SDK'); |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * Creates a new scope with and executes the given operation within. |