|
1 |
| -import { getIntegrationsToSetup, initAndBind, Integrations as CoreIntegrations } from '@sentry/core'; |
| 1 | +import type { ServerRuntimeClientOptions } from '@sentry/core'; |
| 2 | +import { |
| 3 | + getIntegrationsToSetup, |
| 4 | + initAndBind, |
| 5 | + Integrations as CoreIntegrations, |
| 6 | + SDK_VERSION, |
| 7 | + ServerRuntimeClient, |
| 8 | +} from '@sentry/core'; |
2 | 9 | import type { Options } from '@sentry/types';
|
3 | 10 | import { createStackParser, GLOBAL_OBJ, nodeStackLineParser, stackParserFromStackParserOptions } from '@sentry/utils';
|
4 | 11 |
|
5 | 12 | import { getVercelEnv } from '../common/getVercelEnv';
|
6 | 13 | import { setAsyncLocalStorageAsyncContextStrategy } from './asyncLocalStorageAsyncContextStrategy';
|
7 |
| -import { EdgeClient } from './edgeclient'; |
8 | 14 | import { makeEdgeTransport } from './transport';
|
9 | 15 |
|
10 | 16 | const nodeStackParser = createStackParser(nodeStackLineParser());
|
@@ -53,14 +59,30 @@ export function init(options: EdgeOptions = {}): void {
|
53 | 59 | options.instrumenter = 'sentry';
|
54 | 60 | }
|
55 | 61 |
|
56 |
| - const clientOptions = { |
| 62 | + const clientOptions: ServerRuntimeClientOptions = { |
57 | 63 | ...options,
|
58 | 64 | stackParser: stackParserFromStackParserOptions(options.stackParser || nodeStackParser),
|
59 | 65 | integrations: getIntegrationsToSetup(options),
|
60 | 66 | transport: options.transport || makeEdgeTransport,
|
61 | 67 | };
|
62 | 68 |
|
63 |
| - initAndBind(EdgeClient, clientOptions); |
| 69 | + clientOptions._metadata = clientOptions._metadata || {}; |
| 70 | + clientOptions._metadata.sdk = clientOptions._metadata.sdk || { |
| 71 | + name: 'sentry.javascript.nextjs', |
| 72 | + packages: [ |
| 73 | + { |
| 74 | + name: 'npm:@sentry/nextjs', |
| 75 | + version: SDK_VERSION, |
| 76 | + }, |
| 77 | + ], |
| 78 | + version: SDK_VERSION, |
| 79 | + }; |
| 80 | + |
| 81 | + clientOptions.platform = 'edge'; |
| 82 | + clientOptions.runtime = { name: 'edge' }; |
| 83 | + clientOptions.serverName = process.env.SENTRY_NAME; |
| 84 | + |
| 85 | + initAndBind(ServerRuntimeClient, clientOptions); |
64 | 86 |
|
65 | 87 | // TODO?: Sessiontracking
|
66 | 88 | }
|
|
0 commit comments