| 100 | * @see {@link BunOptions} for documentation on configuration options. |
| 101 | */ |
| 102 | export function init(userOptions: BunOptions = {}): NodeClient | undefined { |
| 103 | applySdkMetadata(userOptions, 'bun'); |
| 104 | |
| 105 | const options = { |
| 106 | ...userOptions, |
| 107 | platform: 'javascript', |
| 108 | runtime: { name: 'bun', version: typeof Bun !== 'undefined' ? Bun.version : 'unknown' }, |
| 109 | serverName: userOptions.serverName || global.process.env.SENTRY_NAME || os.hostname(), |
| 110 | }; |
| 111 | |
| 112 | options.transport = options.transport || makeFetchTransport; |
| 113 | |
| 114 | if (options.defaultIntegrations === undefined) { |
| 115 | options.defaultIntegrations = getDefaultIntegrations(options); |
| 116 | } |
| 117 | |
| 118 | return initNode(options); |
| 119 | } |