Skip to content

Commit

Permalink
fix(nextjs): Make withSentryConfig isomorphic (#8166)
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed May 22, 2023
1 parent 6be4e13 commit ad3547d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/nextjs/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ function addClientIntegrations(options: BrowserOptions): void {
options.integrations = integrations;
}

/**
* Just a passthrough in case this is imported from the client.
*/
export function withSentryConfig<T>(exportedUserNextConfig: T): T {
return exportedUserNextConfig;
}

export {
// eslint-disable-next-line deprecation/deprecation
withSentryServerSideGetInitialProps,
Expand Down
7 changes: 7 additions & 0 deletions packages/nextjs/src/edge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ export function lastEventId(): string | undefined {
return getCurrentHub().lastEventId();
}

/**
* Just a passthrough in case this is imported from the client.
*/
export function withSentryConfig<T>(exportedUserNextConfig: T): T {
return exportedUserNextConfig;
}

export { flush } from './utils/flush';

export * from '@sentry/core';
Expand Down
2 changes: 2 additions & 0 deletions packages/nextjs/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export declare const withErrorBoundary: typeof clientSdk.withErrorBoundary;
export declare const Span: typeof edgeSdk.Span;
export declare const Transaction: typeof edgeSdk.Transaction;

export { withSentryConfig } from './config';

/**
* @deprecated Use `wrapApiHandlerWithSentry` instead
*/
Expand Down

0 comments on commit ad3547d

Please sign in to comment.