diff --git a/lib/web-debugger/next.tsx b/lib/web-debugger/next.tsx index 1bc0e7afb..a2ad062a9 100644 --- a/lib/web-debugger/next.tsx +++ b/lib/web-debugger/next.tsx @@ -3,13 +3,18 @@ import { initializeDevCycleDebugger, DebuggerIframeOptions, } from './src/initializeDevCycleDebugger.js' -import { useDevCycleClient } from '@devcycle/nextjs-sdk' +import { useDevCycleClient, DevCycleJSClient } from '@devcycle/nextjs-sdk' export const DevCycleDebugger = (options: DebuggerIframeOptions): null => { const client = useDevCycleClient() useEffect(() => { - const cleanupPromise = initializeDevCycleDebugger(client, options) + // client here is typed as a DevCycleNextClient which is just a Typescript-omitted version of DevCycleClient + // its still a DevCycleClient under the hood, we just want to expose it to Next.js users as having less methods + const cleanupPromise = initializeDevCycleDebugger( + client as DevCycleJSClient, + options, + ) return () => { cleanupPromise.then((cleanup) => cleanup()) } diff --git a/sdk/nextjs/index.ts b/sdk/nextjs/index.ts index 525c50b3b..449a8684c 100644 --- a/sdk/nextjs/index.ts +++ b/sdk/nextjs/index.ts @@ -1,6 +1,7 @@ // Use this file to export React client code (e.g. those with 'use client' directive) // or other non-server utilities -import { DevCycleClient as JSClient } from '@devcycle/js-client-sdk' + +import { DevCycleNextClient } from './src/client/internal/context' export { useVariable, useVariableValue } from './src/client/useVariableValue' export type * from './src/common/types' @@ -18,6 +19,6 @@ export { DVCCustomDataJSON, } from '@devcycle/react-client-sdk' -type DevCycleClient = Omit - -export type { DevCycleClient } +export type DevCycleClient = DevCycleNextClient +export type { DevCycleClient as DevCycleJSClient } from '@devcycle/js-client-sdk' +export type { DevCycleNextClient }