Skip to content

Commit

Permalink
docs: update evaluation details info in the client sdk
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
  • Loading branch information
cre8ivejp committed Feb 27, 2024
1 parent e6b553f commit 4b7d6e0
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 48 deletions.
43 changes: 30 additions & 13 deletions docs/sdk/client-side/android/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,27 +499,44 @@ val user = client.currentUser()

### Getting evaluation details

This method will return the evaluation details for a specific feature flag. It is useful if you need to know the variation reason or send this data elsewhere.
It will return null if the feature flag is missing in the SDK.

<Tabs>
<TabItem value="kt" label="Kotlin">

```kotlin showLineNumbers
val evaluationDetails = client.evaluationDetails("YOUR_FEATURE_FLAG_ID")
```
This method will return the **evaluation details** for a specific feature flag or will return **null** if the feature flag is missing in the SDK's cache.

This is useful if you use another A/B Test solution with Bucketeer and need to know the variation name, reason, and other information.

<details>
<summary><strong>Evaluation details</strong></summary>
<Tabs>
<TabItem value="kt" label="Kotlin">

```kotlin showLineNumbers
data class BKTEvaluation(
var id: String,
val featureId: String,
val featureVersion: Int,
val userId: String,
val variationId: String,
val variationName: String,
val variationValue: String,
val reason: Reason,
)
```

</TabItem>
</Tabs>
</details>

:::caution

Do not call this method without calling the [Evaluating user method](#evaluating-user). The Evaluating user method must always be called because it generates analytics events that will be sent to the server.

:::

:::note

This method will return null if the feature flag is missing in the SDK's cache.
<Tabs>
<TabItem value="kt" label="Kotlin">

:::
```kotlin showLineNumbers
val evaluationDetails = client.evaluationDetails("YOUR_FEATURE_FLAG_ID")
```

</TabItem>
</Tabs>
Expand Down
40 changes: 29 additions & 11 deletions docs/sdk/client-side/flutter/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,26 +482,44 @@ final user = await client.currentUser();

### Getting evaluation details

This method will return the evaluation details for a specific feature flag. This is useful if you need to know the variation reason or send this data elsewhere.

<Tabs>
<TabItem value="dart" label="Dart">
This method will return the **evaluation details** for a specific feature flag or will return **null** if the feature flag is missing in the SDK's cache.

This is useful if you use another A/B Test solution with Bucketeer and need to know the variation name, reason, and other information.

<details>
<summary><strong>Evaluation details</strong></summary>
<Tabs>
<TabItem value="dart" label="Dart">

```dart showLineNumbers
class BKTEvaluation {
final String id;
final String featureId;
final int featureVersion;
final String userId;
final String variationId;
final String variationName;
final String variationValue;
final String reason;
}
```

```dart showLineNumbers
final evaluationDetails = await client.evaluationDetails("YOUR_FEATURE_FLAG_ID");
```
</TabItem>
</Tabs>
</details>

:::caution

Do not call this method without calling the [Evaluating user method](#evaluating-user). The Evaluating user method must always be called because it generates analytics events that will be sent to the server.

:::

:::note

This method will return null if the feature flag is missing in the SDK's cache.
<Tabs>
<TabItem value="dart" label="Dart">

:::
```dart showLineNumbers
final evaluationDetails = await client.evaluationDetails("YOUR_FEATURE_FLAG_ID");
```

</TabItem>
</Tabs>
Expand Down
40 changes: 28 additions & 12 deletions docs/sdk/client-side/ios/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,27 +544,43 @@ let user = client.currentUser()

### Getting evaluation details

This method will return the evaluation details for a specific feature flag. This is useful if you need to know the variation reason or send this data to your own analysis database.
It will return null if the feature flag is missing in the SDK.

<Tabs>
<TabItem value="swift" label="Swift">
This method will return the **evaluation details** for a specific feature flag or will return **nil** if the feature flag is missing in the SDK's cache.

This is useful if you use another A/B Test solution with Bucketeer and need to know the variation name, reason, and other information.

<details>
<summary><strong>Evaluation details</strong></summary>
<Tabs>
<TabItem value="swift" label="Swift">

```swift showLineNumbers
public struct Evaluation {
public let id: String
public let featureID: String
public let featureVersion: Int
public let userID: String
public let variationID: String
public let variationValue: String
public let reason: Int
}
```

```swift showLineNumbers
let evaluationDetails = client.evaluationDetails(featureId: "YOUR_FEATURE_FLAG_ID")
```
</TabItem>
</Tabs>
</details>

:::caution

Do not call this method without calling the [Evaluating user method](#evaluating-user). The Evaluating user method must always be called because it generates analytics events that will be sent to the server.

:::

:::note

This method will return nil if the feature flag is missing in the SDK's cache.
<Tabs>
<TabItem value="swift" label="Swift">

:::
```swift showLineNumbers
let evaluationDetails = client.evaluationDetails(featureId: "YOUR_FEATURE_FLAG_ID")
```

</TabItem>
</Tabs>
Expand Down
46 changes: 35 additions & 11 deletions docs/sdk/client-side/javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,26 +436,50 @@ const user = client?.currentUser();
### Getting evaluation details
This method will return the evaluation details for a specific feature flag. This is useful if you need to know the variation reason or send this data elsewhere.
<Tabs>
<TabItem value="js" label="JavaScript">
This method will return the **evaluation details** for a specific feature flag or will return **null** if the feature flag is missing in the SDK's cache.

This is useful if you use another A/B Test solution with Bucketeer and need to know the variation name, reason, and other information.

<details>
<summary><strong>Evaluation details</strong></summary>
<Tabs>
<TabItem value="js" label="JavaScript">

```js showLineNumbers
export interface BKTEvaluation {
readonly id: string
readonly featureId: string
readonly featureVersion: number
readonly userId: string
readonly variationId: string
readonly variationName: string
readonly variationValue: string
readonly reason:
| 'TARGET'
| 'RULE'
| 'DEFAULT'
| 'CLIENT'
| 'OFF_VARIATION'
| 'PREREQUISITE'
}
```

```js showLineNumbers
const evaluationDetails = client?.evaluationDetails("YOUR_FEATURE_FLAG_ID");
```
</TabItem>
</Tabs>
</details>

:::caution

Do not call this method without calling the [Evaluating user method](#evaluating-user). The Evaluating user method must always be called because it generates analytics events that will be sent to the server.

:::

:::note
This method will return null if the feature flag is missing in the SDK's cache.
<Tabs>
<TabItem value="js" label="JavaScript">

:::
```js showLineNumbers
const evaluationDetails = client?.evaluationDetails("YOUR_FEATURE_FLAG_ID");
```

</TabItem>
</Tabs>
Expand Down
6 changes: 5 additions & 1 deletion src/css/custom.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4b7d6e0

Please sign in to comment.