Contentful Personalization & Analytics
    Preparing search index...
    • Normalizes an optimization config for runtime consumers.

      Parameters

      • config:
            | {
                components?: (
                    | {
                        baseline: { hidden?: boolean; id: string };
                        type?: "EntryReplacement";
                        variants: { hidden?: boolean; id: string }[];
                    }
                    | {
                        baseline: {
                            value: string
                            | number
                            | boolean
                            | Record<string, JSONType>
                            | null;
                        };
                        key: string;
                        type: "InlineVariable";
                        valueType: "Boolean"
                        | "Number"
                        | "Object"
                        | "String";
                        variants: {
                            value: string | number | boolean | Record<string, JSONType> | null;
                        }[];
                    }
                )[];
                distribution?: number[];
                sticky?: boolean;
                traffic?: number;
            }
            | null
            | undefined

        Raw optimization config value from Contentful.

        • {
              components?: (
                  | {
                      baseline: { hidden?: boolean; id: string };
                      type?: "EntryReplacement";
                      variants: { hidden?: boolean; id: string }[];
                  }
                  | {
                      baseline: {
                          value: string
                          | number
                          | boolean
                          | Record<string, JSONType>
                          | null;
                      };
                      key: string;
                      type: "InlineVariable";
                      valueType: "Boolean"
                      | "Number"
                      | "Object"
                      | "String";
                      variants: {
                          value: string | number | boolean | Record<string, JSONType> | null;
                      }[];
                  }
              )[];
              distribution?: number[];
              sticky?: boolean;
              traffic?: number;
          }
          • Optionalcomponents?: (
                | {
                    baseline: { hidden?: boolean; id: string };
                    type?: "EntryReplacement";
                    variants: { hidden?: boolean; id: string }[];
                }
                | {
                    baseline: {
                        value: string
                        | number
                        | boolean
                        | Record<string, JSONType>
                        | null;
                    };
                    key: string;
                    type: "InlineVariable";
                    valueType: "Boolean"
                    | "Number"
                    | "Object"
                    | "String";
                    variants: {
                        value: string | number | boolean | Record<string, JSONType> | null;
                    }[];
                }
            )[]

            Optimization components that define how content is varied.

          • Optionaldistribution?: number[]

            Variant distribution used for traffic allocation.

          • Optionalsticky?: boolean

            Controls whether the assignment should be sticky for a given user.

          • Optionaltraffic?: number

            Percentage of total traffic that should enter the optimization.

        • null
        • undefined

      Returns NormalizedOptimizationConfig

      Config with concrete runtime-safe defaults for omitted fields.