Skip to Main Content
Customer Feedback

We love feedback from you on our products and the problems in your daily work that you would like us to solve. Please describe the challenge you're encountering and your desired outcome. Be as detailed as possible.

For technical issues or bugs please head to Support or our Developer Community. You can assign up to 20 votes in total. Thank you for your feedback.

Status explanation: 'Future Consideration' = Continuing to collect further feedback, not planned at this time. 'Investigating' = Prioritized for deeper customer and feasibility investigations ahead of planning development.

Product Integrations
Created by Guest
Created on Jun 19, 2023

typescript type of datafile from '@optimizely/optimizely-sdk' is not specific enough ("string | object")

Here is the snippet we use:

import type { Config } from '@optimizely/optimizely-sdk';
type OptimizelyDatafile = Config['datafile'];

When you import the type, you can see its string | object

which is clearly not good enough for the object type, because in general shape of datafile is at least the following:
export const FALLBACK_DATAFILE = {
rollouts: [],
typedAudiences: [],
anonymizeIP:true,
variables: [],
featureFlags: [],
experiments: [],
audiences: [],
groups: [],
attributes: [],
botFiltering:true,
events: [],
revision:'1',
version:'4'
};

so clearly the datafile is ought to be more specific than
object, can we get it properly typed in its shape, values and all the fields within it too?