Skip to content

Document evaluation options for JavaScript client methods #2892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1bc3f5a
Document evaluation options for JavaScript client methods
devin-ai-integration[bot] Apr 17, 2025
bc69ec0
Integrate manual exposure logging into method options documentation
devin-ai-integration[bot] Apr 18, 2025
9b449ed
Trigger CI build
devin-ai-integration[bot] Apr 18, 2025
20f7922
Use relative links and remove manual exposures file
devin-ai-integration[bot] Apr 18, 2025
43835af
Update _evaluationOptions.mdx
tore-statsig Apr 18, 2025
d757bc2
Replace ManualExposures with EvaluationOptions template
devin-ai-integration[bot] Apr 18, 2025
7e083ef
Replace all ManualExposures references with EvaluationOptions
devin-ai-integration[bot] Apr 18, 2025
e2455ec
Add server-side EvaluationOptions template
devin-ai-integration[bot] Apr 18, 2025
e5b8085
Fix MDX compilation errors in EvaluationOptions templates
devin-ai-integration[bot] Apr 18, 2025
43a5e96
Fix duplicate EvaluationOptions imports in javascript-sdk.mdx
devin-ai-integration[bot] Apr 18, 2025
1abb45d
Simplify persistent assignment documentation as requested
devin-ai-integration[bot] Apr 21, 2025
fe3efd6
Add EvaluationOptions to server-core Builder sections
devin-ai-integration[bot] Apr 21, 2025
e568445
Fix ManualExposureSnippets reference in node-core.mdx
devin-ai-integration[bot] Apr 21, 2025
cb5a5df
Fix ManualExposureSnippets reference in nodejsServerSDK.mdx
devin-ai-integration[bot] Apr 21, 2025
6944bca
Fix ManualExposureSnippets references in javaSdk.mdx and phpSDK.mdx
devin-ai-integration[bot] Apr 21, 2025
6c7609a
Remove _ManualExposures.mdx from server-core/Templates
devin-ai-integration[bot] Apr 21, 2025
5ad4700
Remove remaining _ManualExposures.mdx files
devin-ai-integration[bot] Apr 21, 2025
08a9cda
Fix ManualExposureSnippets references in client SDK files
devin-ai-integration[bot] Apr 21, 2025
1f46df7
Remove _manualExposures.mdx files from server directory
devin-ai-integration[bot] Apr 21, 2025
a4a94b7
Fix EvaluationOptionsSnippets references in js-on-device-eval-client.mdx
devin-ai-integration[bot] Apr 21, 2025
912ddeb
Fix remaining ManualExposureSnippets references in client SDK files
devin-ai-integration[bot] Apr 21, 2025
2e47ab0
Remove _manualExposures.mdx from js-device-eval-mono directory
devin-ai-integration[bot] Apr 21, 2025
a101552
Remove remaining _manualExposures.mdx files from client subdirectories
devin-ai-integration[bot] Apr 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 0 additions & 90 deletions docs/client/Android/_manualExposures.mdx

This file was deleted.

104 changes: 0 additions & 104 deletions docs/client/AndroidOnDeviceEvaluation/_manualExposures.mdx

This file was deleted.

35 changes: 0 additions & 35 deletions docs/client/React/_manualExposures.mdx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import { VersionBadge } from "../../sdks/_VersionBadge.mdx";

## Manual Exposures
## Method Options <VersionBadge version={props.addedInVersion}/>

When using methods like `checkGate`, `getDynamicConfig`, `getExperiment`, and `getLayer`, you can pass an options object as the second parameter to customize the behavior:

### disableExposureLog `boolean`
> Prevents an exposure log being created for this check. Use this when you want to check a value without recording that the user was exposed to it.
>
> default: `false`

:::warning
Manually logging exposures can be tricky and may lead to an imbalance in exposure events. For example, only triggering exposures for users in the Test group of an experiment will imbalance the experiment, making it useless.
:::

<>
Added in version {props.addedInVersion}, you can now query your
gates/experiments without triggering an exposure as well as manually logging
your exposures.
</>

<Tabs
defaultValue="gate"
values={[
Expand All @@ -24,50 +26,61 @@ Manually logging exposures can be tricky and may lead to an imbalance in exposur

<TabItem value="gate">

To check a gate without an exposure being logged, call the following.
To check a gate without an exposure being logged, call the following:

<div>{props.gateSnippet}</div>

Later, if you would like to expose this gate, you can call the following.
Later, if you would like to expose this gate, you can call the following:

<div>{props.gateExposureSnippet}</div>

</TabItem>

<TabItem value="config">

To get a dynamic config without an exposure being logged, call the following.
To get a dynamic config without an exposure being logged, call the following:

<div>{props.configSnippet}</div>

Later, if you would like to expose the dynamic config, you can call the following.
Later, if you would like to expose the dynamic config, you can call the following:

<div>{props.configExposureSnippet}</div>

</TabItem>

<TabItem value="experiment">

To get an experiment without an exposure being logged, call the following.
To get an experiment without an exposure being logged, call the following:

<div>{props.experimentSnippet}</div>

Later, if you would like to expose the experiment, you can call the following.
Later, if you would like to expose the experiment, you can call the following:

<div>{props.experimentExposureSnippet}</div>

</TabItem>

<TabItem value="layer">

To get a layer parameter without an exposure being logged, call the following.
To get a layer parameter without an exposure being logged, call the following:

<div>{props.layerSnippet}</div>

Later, if you would like to expose the layer parameter, you can call the following.
Later, if you would like to expose the layer parameter, you can call the following:

<div>{props.layerExposureSnippet}</div>

</TabItem>

</Tabs>

{props.userPersistedValues && (
<>
### userPersistedValues `object`
{"> Provide a map of values to be used for persistent experiment assignments. This requires a user persistent storage adapter.\n>\n> Only available for `getExperiment` method."}

<div>{props.userPersistedValuesSnippet}</div>

{"For more information on persistent assignments, see the [Persistent Assignment documentation](/client/concepts/persistent_assignment#example-usage)."}
</>
)}
4 changes: 2 additions & 2 deletions docs/client/Templates/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export const PrefetchUsers = _PrefetchUsers;
import * as _StableID from "./_StableID.mdx";
export const StableID = _StableID;

import * as _ManualExposures from "./_ManualExposures.mdx";
export const ManualExposures = _ManualExposures;
import * as _EvaluationOptions from "./_EvaluationOptions.mdx";
export const EvaluationOptions = _EvaluationOptions;

import * as _Shutdown from "./_Shutdown.mdx";
export const Shutdown = _Shutdown;
Expand Down
6 changes: 3 additions & 3 deletions docs/client/androidClientSDK.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
StatsigUser,
StatsigOptions,
PrefetchUsers,
ManualExposures,
EvaluationOptions,
Shutdown,
LocalOverrides,
StableID,
Expand All @@ -42,7 +42,7 @@ import Options from "./Android/_options.mdx";
import LocalOverridesSnippet from "./Android/_localOverrides.mdx";
import ShutdownSnippet from "./Android/_shutdown.mdx";
import { GetStableID, OverrideStableID } from "./Android/_stableID.mdx";
import { Snippets as ManualExposureSnippets } from "./Android/_manualExposures.mdx";
// EvaluationOptions now replaces manual exposures
import GetParameterStore from "./Android/_getParameterStore.mdx";
import GetParameter from "./Android/_getParameter.mdx";
import MultiInstance from "./Android/_multiInstance.mdx";
Expand Down Expand Up @@ -80,7 +80,7 @@ export const Builder = SDKDocsBuilder({
[StatsigOptions, { options: <Options /> }],
[Shutdown, { shutdown: <ShutdownSnippet /> }],
[LocalOverrides, { localOverrides: <LocalOverridesSnippet /> }],
[ManualExposures, { addedInVersion: "4.9.0", ...ManualExposureSnippets }],
[EvaluationOptions, { addedInVersion: "4.9.0" }],
[
StableID,
{ getSnippet: <GetStableID />, overrideSnippet: <OverrideStableID /> },
Expand Down
2 changes: 1 addition & 1 deletion docs/client/cpp-client-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
StatsigUser,
StatsigOptions,
PrefetchUsers,
ManualExposures,
EvaluationOptions,
Shutdown,
LocalOverrides,
} from "./Templates/index.mdx";
Expand Down
2 changes: 1 addition & 1 deletion docs/client/dartSDK.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
StatsigUser,
StatsigOptions,
PrefetchUsers,
ManualExposures,
EvaluationOptions,
Shutdown,
ParameterStore,
LocalOverrides,
Expand Down
Loading