Interface for extending SDK functionality via hooks.

Hierarchy

  • Hook

Methods

  • This method is called during the execution of the variation method after the flag value has been determined. The method is executed synchronously.

    Parameters

    • hookContext: EvaluationSeriesContext

      Contains read-only information about the evaluation being performed.

    • data: EvaluationSeriesData

      A record associated with each stage of hook invocations. Each stage is called with the data of the previous stage for a series.

    • detail: LDEvaluationDetail

      The result of the evaluation. This value should not be modified.

    Returns EvaluationSeriesData

    Data to use when executing the next state of the hook in the evaluation series. It is recommended to expand the previous input into the return. This helps ensure your stage remains compatible moving forward as more stages are added.

    return {...data, "my-new-field": /*my data/*}
    
  • This method is called during the execution of the identify process before the operation completes, but after any context modifications are performed.

    Parameters

    • hookContext: IdentifySeriesContext

      Contains information about the evaluation being performed. This is not mutable.

    • data: IdentifySeriesData

      A record associated with each stage of hook invocations. Each stage is called with the data of the previous stage for a series. The input record should not be modified.

    • result: IdentifySeriesResult

    Returns IdentifySeriesData

    Data to use when executing the next state of the hook in the evaluation series. It is recommended to expand the previous input into the return. This helps ensure your stage remains compatible moving forward as more stages are added.

    return {...data, "my-new-field": /*my data/*}
    
  • This method is called during the execution of a variation method before the flag value has been determined. The method is executed synchronously.

    Parameters

    • hookContext: EvaluationSeriesContext

      Contains information about the evaluation being performed. This is not mutable.

    • data: EvaluationSeriesData

      A record associated with each stage of hook invocations. Each stage is called with the data of the previous stage for a series. The input record should not be modified.

    Returns EvaluationSeriesData

    Data to use when executing the next state of the hook in the evaluation series. It is recommended to expand the previous input into the return. This helps ensure your stage remains compatible moving forward as more stages are added.

    return {...data, "my-new-field": /*my data/*}
    
  • This method is called during the execution of the identify process before the operation completes, but after any context modifications are performed.

    Parameters

    • hookContext: IdentifySeriesContext

      Contains information about the evaluation being performed. This is not mutable.

    • data: IdentifySeriesData

      A record associated with each stage of hook invocations. Each stage is called with the data of the previous stage for a series. The input record should not be modified.

    Returns IdentifySeriesData

    Data to use when executing the next state of the hook in the evaluation series. It is recommended to expand the previous input into the return. This helps ensure your stage remains compatible moving forward as more stages are added.

    return {...data, "my-new-field": /*my data/*}
    
  • Get metadata about the hook implementation.

    Returns HookMetadata

Generated using TypeDoc