Output Type Comparison
This section provides a comparison of SDK output types, highlighting their pros, cons, and example uses for effective implementation.
Component
The following sections describe the pros, cons, and example uses for each SDK output type.
- Add custom HTML.
- Simplify reuse of code components.
- Use less processing time.
Cons
- Requires knowledge of HTML.
- If referencing an external UI component, you must know the source URL and it must be available.
Example Use
- Customize fonts, colors, sizes, and positioning using HTML.
- Include an external UI component in your page.
Enum
- Consistent response
- Ease of debugging
- Avoid hardcoding of messages
- Your code must be able to understand and process the Enum value
- Can only use constant values
Example Use
- Allow or deny access to a feature when using your own CDN.
- Specify the user experience through a predefined list of options.
String
Pros
- Simple to define and update.
Cons
- No additional formatting can be applied.
- Your code must be able to understand and process the string values.
Example Use
- Return a value that is recognized by your code.
- Display a message in the appropriate language.
Number
Pros
- Simple to define and update.
Cons
- Your code must be able to understand and process the numeric values.
Example Use
- Return a numerical code that is recognized by your software.
JSON
Pros
- A single JSON output can contain a comprehensive dataset, useful for building a more powerful page.
- Technical and non-technical users can collaborate on creating JSON schemas and outputs.
- Non-technical users enjoy greater flexibility in achieving desired outcomes, reducing dependence on technical teams.
Cons
- Requires technical knowledge of HTML, CSS, and JavaScript to create JSON schemas.
Example Use
- Return structured data for use in custom logic.
- Share complex content models with other systems.
Transformation
Pros
- Supports the use of out-of-box forms in SDK rules.
Cons
- Requires knowledge of HTML, CSS, and JavaScript.
Example Use
- Map SDK feature inputs to outcomes through reusable forms.