Zephr User Guide

Create an SDK Feature

13 views 0

To create an SDK feature, complete the following steps:

  1. Select Products
  2. Select Features
  3. The Features screen displays, as illustrated below:

    “Features"

  4. Select the Add a Feature button

    The Add a Feature screen displays, as illustrated below:

    “Add

  5. Enter a name for the feature in the Title text box
  6. Optionally, enter a description of the feature in the Description text box
  7. Select the SDK radio button from the Type of Integration options
  8. Select the Continue button

    The SDK Outputs screen displays, as illustrated below:

    “SDK

  9. If required, update the slug in the Slug text box

    Use the slug to reference this feature in your code.

  10. Define the information to provide to Zephr by enabling or disabling the Inputs

    The inputs are as follows:

    • Session

      Note: The Session input is required for Registered and Customer states.

    • IP Address
    • User Agent
    • Path
    • Content ID

    By default, all inputs are enabled.

    If you do not require an input, select the toggle at the end of the row.

  11. Define any Custom Inputs used to provide information to Zephr

    To define custom inputs, complete the following steps:

    1. Select the Add Input button

      The Add Input dialog box displays, as illustrated below:

      “Add

    2. Enter a name for the custom input in the Title text box
    3. Enter the identifier used for the input in the Key text box
    4. Select the type of input from the Type drop-down options. The options are as follows:
      • String
      • Number
      • Boolean
    5. Select the Add button to add the custom input and return to the SDK Outputs screen. Selecting the Cancel button displays the SDK Outputs screen without adding a custom input
  12. Define the output to use in your feature rule from the Type drop-down menu. The options are as follows:
    • Component
    • Enum
    • String
    • Number

    For further information on these output types, see the Output Types topic.

  13. If you select Component or Enum from the Type drop-down menu, select the Add Option button

    If you select Component, the Add Option dialog displays as illustrated below:

    “Add

    To define the component output, complete the following steps:

    1. Enter a name for the output in the Title text box
    2. Enter the HTML code to render in the outcome in the Value text box
    3. Select the Add button to save the output and return to the SDK Outputs screen. Selecting the Cancel button displays the SDK Outputs screen without saving the output

    If you select Enum, the Add Option dialog displays as illustrated below:

    “Add

    To define the enum output, complete the following steps:

    1. Enter a name for the output in the Title text box
    2. Enter the enum data to render in the outcome in the Value text box
    3. Select the Add button to save the output and return to the SDK Outputs screen. Selecting the Cancel button displays the SDK Outputs screen without saving the output
  14. Obtain the implementation code, which can be used to flag the feature in your code

    To obtain the implementation code, complete the following steps:

    1. Select the language in which you want the code from the Select Language drop-down menu. The options are as follows:
      • cURL
      • Browser
      • Node JS
      • Java
    2. If you select Browser, Node JS, or Java from the Select Language drop-down menu options, install the relevant SDK if not already installed

      The command to install the relevant SDK is displayed beneath the drop-down menu.

      For further information on the SDKs and their installation, see the Zephr SDK section.

    3. Select Copy, which displays in the top-right of the code box when you hover over the Usage code sample

      The code is copied to your clipboard.

  15. Select the Update & Lock button

You can build your rule using the output in the Rules Builder. For further information on the available decision nodes, see the Feature Decision Nodes topic.

Select the Save button to save your SDK Feature, or select the up arrow then the Save & Publish button to save your SDK feature and make it available for use.