• Convert a variant param to a list of variant aliases

    Returns alist of variant aliases from a variant param.

    The variant param can be passed as a query parameter in the URL to send the list of variants activated for the current user. This helper method is typically used in server side code to decode the variant parameter as a list of variant aliases that can be passed to the CMS Delivery API.

    Parameters

    • variantParam: string

      The variant param generated by Personalize.getVariantParam()

    Returns string[]

    The list of variant aliases

    const variantParam = Personalize.getVariantParam(); // 'a_0,b_1'
    Personalize.variantParamToVariantAliases(variantParam); // ['cs_personalize_a_0', 'cs_personalize_b_1']