Skip to Main Content
Optimizely Data Platform
Workspace 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: [],
variables: [],
featureFlags: [],
experiments: [],
audiences: [],
groups: [],
attributes: [],
events: [],

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?
  • Attach files