diff --git a/sdk/nextjs/src/client/useVariableValue.ts b/sdk/nextjs/src/client/useVariableValue.ts index 106a70c64..4ce7ad549 100644 --- a/sdk/nextjs/src/client/useVariableValue.ts +++ b/sdk/nextjs/src/client/useVariableValue.ts @@ -1,7 +1,11 @@ 'use client' import { DevCycleClient } from '@devcycle/js-client-sdk' import { useContext, use } from 'react' -import { VariableDefinitions, VariableKey } from '@devcycle/types' +import { + InferredVariableType, + VariableDefinitions, + VariableKey, +} from '@devcycle/types' import { DVCVariable } from '@devcycle/js-client-sdk' import { DevCycleProviderContext } from './internal/context' import { useRerenderOnVariableChange } from './internal/useRerenderOnVariableChange' @@ -30,7 +34,7 @@ export const useVariableValue = < >( key: K, defaultValue: ValueType, -): DVCVariable['value'] => { +): InferredVariableType => { return useVariable(key, defaultValue).value } diff --git a/sdk/nextjs/src/server/getVariableValue.ts b/sdk/nextjs/src/server/getVariableValue.ts index 21c8056f1..031d2a57a 100644 --- a/sdk/nextjs/src/server/getVariableValue.ts +++ b/sdk/nextjs/src/server/getVariableValue.ts @@ -1,5 +1,6 @@ import { getClient } from './requestContext' import { + InferredVariableType, VariableDefinitions, VariableKey, VariableTypeAlias, @@ -8,7 +9,10 @@ import { export async function getVariableValue< K extends VariableKey, ValueType extends VariableDefinitions[K], ->(key: K, defaultValue: ValueType): Promise> { +>( + key: K, + defaultValue: ValueType, +): Promise> { const client = getClient() if (!client) { console.error(