From ca2d5beb935ed9ee10706779f9b1e5c737deaad4 Mon Sep 17 00:00:00 2001 From: Brock Lumbard Date: Mon, 16 Dec 2024 19:53:47 -0800 Subject: [PATCH] added manual exposures for java --- docs/server/java/_manualExposures.mdx | 53 +++++++++++++++++++++++++++ docs/server/javaSdk.mdx | 2 + 2 files changed, 55 insertions(+) create mode 100644 docs/server/java/_manualExposures.mdx diff --git a/docs/server/java/_manualExposures.mdx b/docs/server/java/_manualExposures.mdx new file mode 100644 index 000000000..c75197e85 --- /dev/null +++ b/docs/server/java/_manualExposures.mdx @@ -0,0 +1,53 @@ +import CodeBlock from "@theme/CodeBlock"; + +import ManualExposuresTemplate from "../../sdks/_manual-exposures-template.mdx"; + +export const Snippets = { + // Gates + gateSnippet: ( + + {`val passed_or_failed = Statsig.checkGateWithExposureLoggingDisabled(user, "a_gate");`} + + ), + gateExposureSnippet: ( + + {`Statsig.manuallyLogGateExposure(user, "a_gate");`} + + ), + // Configs + configSnippet: ( + + {`val config = Statsig.getConfigWithExposureLoggingDisabled(user, "awesome_product_details")`} + + ), + configExposureSnippet: ( + + {`Statsig.manuallyLogConfigExposure(user, "awesome_product_details");`} + + ), + // Experiment + experimentSnippet: ( + + {`val titleExperiment = Statsig.getExperimentWithExposureLoggingDisabled(user, "new_user_promo_title")`} + + ), + experimentExposureSnippet: ( + + {`Statsig.manuallyLogConfigExposure(user, "new_user_promo_title");`} + + ), + // Layer + layerSnippet: ( + + {`val layer = Statsig.getLayerWithExposureLoggingDisabled(user, "user_promo_experiments") +val promoTitle = layer.getString("title", "Welcome to Statsig!")`} + + ), + layerExposureSnippet: ( + + {`Statsig.manuallyLogLayerParameterExposure(user, "user_promo_experiments");`} + + ), +}; + +; diff --git a/docs/server/javaSdk.mdx b/docs/server/javaSdk.mdx index c7990e8a4..a9e685638 100644 --- a/docs/server/javaSdk.mdx +++ b/docs/server/javaSdk.mdx @@ -40,6 +40,7 @@ import ShutdownSnippet from "./java/_shutdown.mdx"; import OverridesSnippet from "./java/_localOverrides.mdx"; import * as ReferenceSnippets from "./java/_reference.mdx"; import ClientInitResponseSnippet from "./java/_clientInitResponse.mdx"; +import { Snippets as ManualExposureSnippets } from "./java/_manualExposures.mdx"; import ForwardProxyExample from "./java/_forwardProxyExample.mdx"; import MultiInstanceExample from "./java/_multiInstanceExample.mdx"; import PersistentStorageInterface from "./java/_persistentStorageInterface.mdx"; @@ -91,6 +92,7 @@ export const Builder = SDKDocsBuilder({ snippet: , }, ], + [ManualExposures, { addedInVersion: "0.11.0", ...ManualExposureSnippets }], [ UserPersistentStorage, { interface: , example: },