From d35fe71dae2f0b6da0703f30031dd4bc6f1fd97b Mon Sep 17 00:00:00 2001 From: Cal Courtney Date: Wed, 15 Apr 2026 10:10:37 +0100 Subject: [PATCH 01/14] feat(ft-1848): update sdk docs to be learning-focused --- .../Advanced/_category_.json | 5 - .../Advanced/context-attributes.mdx | 9 - .../Advanced/custom-assignments.mdx | 9 - .../_custom-assignments.mdx | 249 ------- .../SDK-Documentation/Advanced/finalize.mdx | 9 - .../SDK-Documentation/Advanced/publish.mdx | 9 - .../Advanced/publish/_publish.mdx | 133 ---- .../Advanced/tracking-goals.mdx | 9 - .../using-custom-fields-in-your-code.mdx | 73 -- .../SDK-Documentation/_category_.json | 3 +- .../_create-context-basic.mdx | 209 ++++++ .../SDK-Documentation/_initialize-basic.mdx | 527 +++++++++++++++ .../_selecting-a-treatment-basic.mdx | 140 ++++ .../_selecting-a-variable-basic.mdx | 91 +++ .../config-api/_config-api.mdx | 39 +- .../config-api/js/configChangeParameters.js | 0 .../config-api/js/getVariantVariableKeys.js | 0 .../config-api/js/languagesConfig.js | 0 .../config-api/js/mergeConfig.js | 0 .../config-api/js/mergeTranslationConfigs.js | 0 .../config-api/js/returnedConfig.js | 0 .../_setting-context-attributes.mdx | 17 +- .../dotnet/setAttributes.cs | 0 .../flutter/setAttributes.dart | 0 .../context-attributes}/go/setAttributes.go | 0 .../java/setAttributes.java | 0 .../context-attributes}/js/setAttributes.js | 0 .../context-attributes}/php/setAttributes.php | 0 .../python/setAttributes.py | 0 .../react/setAttributes.js | 2 + .../react/setAttributesAsProps.tsx | 0 .../context-attributes}/ruby/setAttributes.rb | 0 .../swift/setAttributes.swift | 0 .../context-attributes}/vue/SetAttributes.vue | 0 .../context-attributes}/vue/setAttributes.js | 0 .../_custom-assignments.mdx | 172 +++++ .../dotnet/customAssignment.cs | 0 .../dotnet/customAssignments.cs | 0 .../flutter/customAssignment.dart | 0 .../flutter/customAssignments.dart | 0 .../custom-assignments/go/customAssignment.go | 0 .../go/customAssignments.go | 0 .../java/customAssignment.java | 0 .../java/customAssignments.java | 0 .../custom-assignments/js/customAssignment.js | 0 .../js/customAssignments.js | 0 .../php/customAssignment.php | 0 .../php/customAssignments.php | 0 .../python/customAssignment.py | 0 .../python/customAssignments.py | 0 .../react/customAssignment.js | 2 + .../react/customAssignments.js | 2 + .../ruby/customAssignment.rb | 0 .../ruby/customAssignments.rb | 0 .../swift/customAssignment.swift | 0 .../swift/customAssignments.swift | 0 .../vue/customAssignment.js | 0 .../vue/customAssignments.js | 0 .../_custom-event-logger.mdx | 133 ++++ .../dotnet/customEventLogger.cs | 0 .../dotnet/customEventLoggerInjection.cs | 0 .../flutter/customEventLogger.dart | 0 .../custom-event-logger/flutter/usage.dart | 0 .../go/customEventLogger.go | 0 .../java/customEventLogger.java | 0 .../js/customEventLogger.js | 0 .../php/customEventLogger.php | 0 .../custom-event-logger/php/handleEvent.php | 0 .../python/customEventLogger.py | 0 .../react/customEventLogger.jsx | 0 .../ruby/customEventLogger.rb | 33 + .../swift/customEventLogger.swift | 0 .../vue/customEventLogger.js | 0 .../finalize/_finalize.mdx | 12 +- .../finalize/dotnet/finalize.cs | 0 .../finalize/flutter/finalize.dart | 0 .../finalize/go/finalize.go | 0 .../finalize/java/finalize.java | 0 .../finalize/js/finalize.js | 0 .../finalize/php/finalize.php | 0 .../finalize/python/finalize.py | 0 .../finalize/react/finalize.js | 2 + .../finalize/ruby/finalize.rb | 0 .../finalize/swift/finalize.swift | 0 .../finalize/vue/finalize.js | 0 .../install/_install.mdx | 169 ++--- .../install/dotnet/install.bash | 0 .../install/flutter/install.yaml | 0 .../install/go/dependencies.bash | 0 .../install/go/go.mod | 0 .../.gradle/7.4.2/checksums/checksums.lock | Bin .../dependencies-accessors.lock | Bin .../dependencies-accessors/gc.properties | 0 .../.gradle/7.4.2/fileChanges/last-build.bin | Bin .../.gradle/7.4.2/fileHashes/fileHashes.lock | Bin .../install/java/.gradle/7.4.2/gc.properties | 0 .../buildOutputCleanup.lock | Bin .../buildOutputCleanup/cache.properties | 0 .../install/java/.gradle/vcs-1/gc.properties | 0 .../install/java/.project | 0 .../org.eclipse.buildship.core.prefs | 0 .../install/java/build.gradle | 0 .../install/java/pom.xml | 0 .../install/js/directImport.html | 0 .../install/js/install.bash | 0 .../install/php/install.bash | 0 .../install/python/install.bash | 0 .../install/react/install.bash | 0 .../install/ruby/bundler.sh | 0 .../install/ruby/gem.sh | 0 .../install/swift/Podfile | 0 .../install/swift/updateXcode.bash | 0 .../install/vue/directImport.html | 0 .../install/vue/install.bash | 0 .../install/vue3/directImport.html | 0 .../install/vue3/install.bash | 0 .../overriding/_overriding.mdx | 80 +-- .../overriding/dotnet/override.cs | 0 .../overriding/flutter/override.dart | 0 .../overriding/go/override.go | 0 .../overriding/java/override.java | 0 .../overriding/js/override.js | 0 .../overriding/php/override.php | 0 .../overriding/python/override.py | 0 .../overriding/react/override.js | 2 + .../overriding/ruby/override.rb | 0 .../overriding/swift/override.swift | 0 .../overriding/vue/inInitialization.js | 0 .../overriding/vue/withOverrideMethods.js | 0 .../peeking/_peeking.mdx | 46 +- .../peeking/dotnet/peekAtVariables.cs | 0 .../peeking/dotnet/peekAtVariants.cs | 0 .../peeking/flutter/peekAtVariables.dart | 0 .../peeking/flutter/peekAtVariants.dart | 0 .../peeking/go/peekAtVariables.go | 0 .../peeking/go/peekAtVariants.go | 0 .../peeking/java/peekAtVariables.java | 0 .../peeking/java/peekAtVariants.java | 0 .../peeking/js/peekAtVariables.js | 0 .../peeking/js/peekAtVariant.js | 0 .../peeking/php/peekAtVariable.php | 0 .../peeking/php/peekAtVariant.php | 0 .../peeking/python/peekAtVariables.py | 0 .../peeking/python/peekAtVariant.py | 0 .../peeking/react/peekAtVariables.js | 2 + .../peeking/react/peekAtVariant.js | 2 + .../peeking/ruby/peekAtVariables.rb | 0 .../peeking/ruby/peekAtVariants.rb | 0 .../peeking/swift/peekAtVariables.swift | 0 .../peeking/swift/peekAtVariants.swift | 0 .../peeking/vue/peekAtVariables.js | 0 .../peeking/vue/peekAtVariant.js | 0 .../_shared/publish/_publish.mdx | 113 ++++ .../publish/dotnet/publish.cs | 0 .../publish/flutter/publish.dart | 0 .../publish/go/publish.go | 0 .../publish/java/publish.java | 0 .../publish/js/publish.js | 0 .../publish/php/publish.php | 0 .../publish/python/publish.py | 0 .../publish/react/publish.js | 2 + .../publish/ruby/publish.rb | 0 .../publish/swift/publish.swift | 0 .../publish/vue/publish.js | 0 .../dotnet/selectingATreatment.cs | 7 + .../flutter/selectingATreatment.dart | 7 + .../go/selectingATreatment.go | 7 + .../java/selectingATreatment.java | 7 + .../js/selectingATreatment.js | 7 + .../php/selectingATreatment.php | 7 + .../python/selectingATreatment.py | 6 + .../react/selectingATreatment.js | 0 .../react/usingTernaryOperator.js | 0 .../react/usingUseTreatment.js | 7 + .../ruby/selectingATreatment.rb | 7 + .../swift/selectingATreatment.swift | 7 + .../vue/UsingOnlyDefaultSlot.vue | 6 +- .../vue/UsingTreatmentAlias.vue | 8 + .../vue/UsingTreatmentIndex.vue | 8 +- .../dotnet/selectingAVariable.cs | 2 + .../flutter/selectingAVariable.dart | 2 + .../go/selectingAVariable.go | 2 + .../java/selectingAVariable.java | 2 + .../js/selectingAVariable.js | 2 + .../php/selectingAVariable.php | 2 + .../python/selectingAVariable.py | 2 + .../react/directlyInTreatmentComponent.js | 0 .../selecting-a-variable/react/inUseEffect.js | 4 + .../ruby/selectingAVariable.rb | 2 + .../swift/selectingAVariable.swift | 2 + .../vue/selectingAVariable.js | 2 + .../tracking-goals/_tracking-goals.mdx | 22 +- .../tracking-goals/dotnet/trackingGoals.cs | 0 .../tracking-goals/flutter/trackingGoals.dart | 0 .../tracking-goals/go/trackingGoals.go | 0 .../tracking-goals/java/trackingGoals.java | 0 .../tracking-goals/js/trackingGoals.js | 0 .../tracking-goals/php/trackingGoals.php | 0 .../tracking-goals/python/trackingGoals.py | 0 .../tracking-goals/react/trackingGoals.js | 2 + .../tracking-goals/ruby/trackingGoals.rb | 0 .../tracking-goals/swift/trackingGoals.swift | 0 .../tracking-goals/vue/trackingGoals.js | 0 .../SDK-Documentation/basic-usage.mdx | 36 - .../_selecting-a-treatment.mdx | 256 ------- .../dotnet/selectingATreatment.cs | 5 - .../flutter/selectingATreatment.dart | 5 - .../go/selectingATreatment.go | 6 - .../java/selectingATreatment.java | 5 - .../js/selectingATreatment.js | 25 - .../php/selectingATreatment.php | 8 - .../python/selectingATreatment.py | 5 - .../react/usingUseTreatment.js | 15 - .../ruby/selectingATreatment.rb | 7 - .../swift/selectingATreatment.swift | 6 - .../vue/UsingTreatmentAlias.vue | 11 - .../_selecting-a-variable.mdx | 152 ----- .../dotnet/selectingAVariable.cs | 1 - .../flutter/selectingAVariable.dart | 3 - .../go/selectingAVariable.go | 3 - .../java/selectingAVariable.java | 3 - .../js/selectingAVariable.js | 6 - .../php/selectingAVariable.php | 2 - .../python/selectingAVariable.py | 1 - .../selecting-a-variable/react/inUseEffect.js | 13 - .../ruby/selectingAVariable.rb | 3 - .../swift/selectingAVariable.swift | 1 - .../vue/selectingAVariable.js | 6 - .../checking-variants-without-exposures.mdx | 51 ++ .../complete-example/_complete-example.mdx | 68 ++ .../dotnet/completeExample.cs | 58 ++ .../flutter/completeExample.dart | 51 ++ .../complete-example/go/completeExample.go | 60 ++ .../java/completeExample.java | 49 ++ .../complete-example/js/completeExample.js | 54 ++ .../complete-example/php/completeExample.php | 44 ++ .../python/completeExample.py | 44 ++ .../react/completeExample.jsx | 70 ++ .../complete-example/ruby/completeExample.rb | 42 ++ .../swift/completeExample.swift | 47 ++ .../complete-example/vue/completeExample.js | 51 ++ .../complete-example/vue3/completeExample.js | 53 ++ .../SDK-Documentation/config-api.mdx | 76 +++ .../SDK-Documentation/getting-started.mdx | 50 +- .../_create-new-context-request.mdx | 627 ------------------ .../dotnet/async.cs | 4 - .../dotnet/extraUnits.cs | 5 - .../dotnet/prefetchedData.cs | 8 - .../dotnet/refreshWithFreshData.cs | 3 - .../dotnet/refreshWithRefreshMethod.cs | 3 - .../create-new-context-request/dotnet/sync.cs | 4 - .../flutter/async.dart | 11 - .../flutter/extraUnits.dart | 4 - .../flutter/refreshWithFreshData.dart | 3 - .../flutter/refreshWithRefresh.dart | 1 - .../flutter/sync.dart | 11 - .../flutter/withPrefetchedData.dart | 11 - .../create-new-context-request/go/async.go | 8 - .../go/extraUnits.go | 5 - .../go/refreshWithFreshData.go | 4 - .../go/refreshWithRefreshMethod.go | 1 - .../create-new-context-request/go/sync.go | 8 - .../java/async.java | 7 - .../java/extraUnits.java | 5 - .../java/preFetchedData.java | 12 - .../java/refreshWithFreshData.java | 3 - .../java/refreshWithRefreshMethod.java | 1 - .../create-new-context-request/java/sync.java | 6 - .../js/httpRequestCancellation.js | 17 - .../js/httpRequestTimeout.js | 9 - .../js/refreshWithFreshData.js | 9 - .../js/refreshWithRefreshMethod.js | 7 - .../js/usingAsyncAwait.js | 18 - .../js/usingRawPromises.js | 20 - .../js/withPreFetchedData.js | 22 - .../php/extraUnits.php | 1 - .../php/prefetchedData.php | 9 - .../php/refresh.php | 1 - .../create-new-context-request/php/sync.php | 4 - .../python/async.py | 8 - .../python/extraUnits.py | 5 - .../python/refreshWithFreshData.py | 2 - .../python/refreshWithRefreshMethod.py | 1 - .../create-new-context-request/python/sync.py | 8 - .../python/withPrefetchedData.py | 10 - .../react/forTernaryOperator.js | 43 -- .../react/newContext.js | 17 - .../react/withABSmartly.js | 18 - .../ruby/createContext.rb | 1 - .../ruby/extraUnits.rb | 3 - .../ruby/extraUnitsAlt.rb | 5 - .../ruby/prefetchedData.rb | 10 - .../swift/newContext.swift | 7 - .../swift/refreshWithFreshData.swift | 3 - .../swift/refreshWithRefreshMethod.swift | 3 - .../swift/settingExtraUnits.swift | 4 - .../swift/withPreFetchedData.swift | 4 - .../vue/RefreshWithFreshData.js | 8 - .../vue/initializeWithPrefetchedData.js | 18 - .../vue/refreshWithRefreshMethod.js | 7 - .../vue3/manualRefresh.js | 7 - .../vue3/prefetched.js | 18 - .../vue3/refresh.js | 8 - .../create-new-context-request/vue3/sync.js | 16 - .../_custom-event-logger.mdx | 280 -------- .../_import-and-initialize.mdx | 385 ----------- .../dotnet/manualSDKInstance.cs | 16 - .../dotnet/sdkInjection.cs | 15 - .../dotnet/startupCode.cs | 10 - .../import-and-initialize/flutter/import.dart | 11 - .../import-and-initialize/go/initialize.go | 14 - .../import-and-initialize/java/import.java | 21 - .../java/importForAndroid6.java | 22 - .../import-and-initialize/js/import.js | 12 - .../php/granularChoice.php | 22 - .../php/importAndInitialize.php | 8 - .../php/paramsInOrder.php | 5 - .../import-and-initialize/python/import.py | 15 - .../import-and-initialize/react/import.jsx | 29 - .../import-and-initialize/ruby/import.rb | 6 - .../import-and-initialize/swift/import.swift | 17 - .../import-and-initialize/vue/import.js | 22 - .../import-and-initialize/vue3/import.js | 25 - .../APIs-and-SDKs/SDK-Documentation/index.mdx | 56 +- .../managing-the-context-lifecycle.mdx | 521 +++++++++++++++ .../pre-fetching-context-data.mdx | 306 +++++++++ .../running-your-first-experiment.mdx | 129 ++++ .../targeting-and-audiences.mdx | 82 +++ .../SDK-Documentation/using-custom-fields.mdx | 191 ++++++ ...riable.mdx => using-variables-as-code.mdx} | 87 ++- .../Segment-Integration/index.mdx | 4 +- .../Zuko-Integration.mdx | 2 +- .../experiments/creating-an-experiment.mdx | 8 +- .../feature-flags/creating-a-feature.mdx | 2 +- 334 files changed, 3880 insertions(+), 3445 deletions(-) delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/Advanced/_category_.json delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/_custom-assignments.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/_publish.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/Advanced/using-custom-fields-in-your-code.mdx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_create-context-basic.mdx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_initialize-basic.mdx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_selecting-a-treatment-basic.mdx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_selecting-a-variable-basic.mdx rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/config-api/_config-api.mdx (82%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/config-api/js/configChangeParameters.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/config-api/js/getVariantVariableKeys.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/config-api/js/languagesConfig.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/config-api/js/mergeConfig.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/config-api/js/mergeTranslationConfigs.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/config-api/js/returnedConfig.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/_setting-context-attributes.mdx (84%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/dotnet/setAttributes.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/flutter/setAttributes.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/go/setAttributes.go (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/java/setAttributes.java (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/js/setAttributes.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/php/setAttributes.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/python/setAttributes.py (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/react/setAttributes.js (92%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/react/setAttributesAsProps.tsx (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/ruby/setAttributes.rb (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/swift/setAttributes.swift (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/vue/SetAttributes.vue (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/context-attributes/setting-context-attributes => _shared/context-attributes}/vue/setAttributes.js (100%) create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/_custom-assignments.mdx rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/dotnet/customAssignment.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/dotnet/customAssignments.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/flutter/customAssignment.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/flutter/customAssignments.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/go/customAssignment.go (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/go/customAssignments.go (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/java/customAssignment.java (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/java/customAssignments.java (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/js/customAssignment.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/js/customAssignments.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/php/customAssignment.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/php/customAssignments.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/python/customAssignment.py (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/python/customAssignments.py (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/react/customAssignment.js (69%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/react/customAssignments.js (80%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/ruby/customAssignment.rb (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/ruby/customAssignments.rb (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/swift/customAssignment.swift (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/swift/customAssignments.swift (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/vue/customAssignment.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/custom-assignments/vue/customAssignments.js (100%) create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/_custom-event-logger.mdx rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/dotnet/customEventLogger.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/dotnet/customEventLoggerInjection.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/flutter/customEventLogger.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/flutter/usage.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/go/customEventLogger.go (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/java/customEventLogger.java (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/js/customEventLogger.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/php/customEventLogger.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/php/handleEvent.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/python/customEventLogger.py (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/react/customEventLogger.jsx (100%) create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/ruby/customEventLogger.rb rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/swift/customEventLogger.swift (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/custom-event-logger/vue/customEventLogger.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/_finalize.mdx (92%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/dotnet/finalize.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/flutter/finalize.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/go/finalize.go (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/java/finalize.java (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/js/finalize.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/php/finalize.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/python/finalize.py (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/react/finalize.js (68%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/ruby/finalize.rb (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/swift/finalize.swift (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/finalize/vue/finalize.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/_install.mdx (78%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/dotnet/install.bash (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/flutter/install.yaml (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/go/dependencies.bash (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/go/go.mod (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.gradle/7.4.2/checksums/checksums.lock (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.gradle/7.4.2/dependencies-accessors/gc.properties (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.gradle/7.4.2/fileChanges/last-build.bin (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.gradle/7.4.2/fileHashes/fileHashes.lock (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.gradle/7.4.2/gc.properties (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.gradle/buildOutputCleanup/buildOutputCleanup.lock (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.gradle/buildOutputCleanup/cache.properties (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.gradle/vcs-1/gc.properties (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.project (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/.settings/org.eclipse.buildship.core.prefs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/build.gradle (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/java/pom.xml (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/js/directImport.html (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/js/install.bash (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/php/install.bash (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/python/install.bash (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/react/install.bash (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/ruby/bundler.sh (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/ruby/gem.sh (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/swift/Podfile (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/swift/updateXcode.bash (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/vue/directImport.html (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/vue/install.bash (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/vue3/directImport.html (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{getting-started => _shared}/install/vue3/install.bash (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/_overriding.mdx (52%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/dotnet/override.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/flutter/override.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/go/override.go (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/java/override.java (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/js/override.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/php/override.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/python/override.py (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/react/override.js (80%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/ruby/override.rb (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/swift/override.swift (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/vue/inInitialization.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/overriding/vue/withOverrideMethods.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/_peeking.mdx (66%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/dotnet/peekAtVariables.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/dotnet/peekAtVariants.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/flutter/peekAtVariables.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/flutter/peekAtVariants.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/go/peekAtVariables.go (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/go/peekAtVariants.go (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/java/peekAtVariables.java (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/java/peekAtVariants.java (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/js/peekAtVariables.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/js/peekAtVariant.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/php/peekAtVariable.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/php/peekAtVariant.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/python/peekAtVariables.py (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/python/peekAtVariant.py (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/react/peekAtVariables.js (65%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/react/peekAtVariant.js (88%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/ruby/peekAtVariables.rb (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/ruby/peekAtVariants.rb (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/swift/peekAtVariables.swift (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/swift/peekAtVariants.swift (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/vue/peekAtVariables.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/peeking/vue/peekAtVariant.js (100%) create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/_publish.mdx rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/dotnet/publish.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/flutter/publish.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/go/publish.go (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/java/publish.java (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/js/publish.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/php/publish.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/python/publish.py (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/react/publish.js (68%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/ruby/publish.rb (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/swift/publish.swift (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/publish/vue/publish.js (100%) create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/dotnet/selectingATreatment.cs create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/flutter/selectingATreatment.dart create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/go/selectingATreatment.go create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/java/selectingATreatment.java create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/js/selectingATreatment.js create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/php/selectingATreatment.php create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/python/selectingATreatment.py rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/selecting-a-treatment/react/selectingATreatment.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/selecting-a-treatment/react/usingTernaryOperator.js (100%) create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/react/usingUseTreatment.js create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/ruby/selectingATreatment.rb create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/swift/selectingATreatment.swift rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/selecting-a-treatment/vue/UsingOnlyDefaultSlot.vue (50%) create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/vue/UsingTreatmentAlias.vue rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/selecting-a-treatment/vue/UsingTreatmentIndex.vue (54%) create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/dotnet/selectingAVariable.cs create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/flutter/selectingAVariable.dart create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/go/selectingAVariable.go create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/java/selectingAVariable.java create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/js/selectingAVariable.js create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/php/selectingAVariable.php create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/python/selectingAVariable.py rename docs/APIs-and-SDKs/SDK-Documentation/{basic-usage => _shared}/selecting-a-variable/react/directlyInTreatmentComponent.js (100%) create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/react/inUseEffect.js create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/ruby/selectingAVariable.rb create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/swift/selectingAVariable.swift create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/vue/selectingAVariable.js rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/_tracking-goals.mdx (69%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/dotnet/trackingGoals.cs (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/flutter/trackingGoals.dart (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/go/trackingGoals.go (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/java/trackingGoals.java (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/js/trackingGoals.js (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/php/trackingGoals.php (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/python/trackingGoals.py (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/react/trackingGoals.js (80%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/ruby/trackingGoals.rb (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/swift/trackingGoals.swift (100%) rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced => _shared}/tracking-goals/vue/trackingGoals.js (100%) delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/_selecting-a-treatment.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/dotnet/selectingATreatment.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/flutter/selectingATreatment.dart delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/go/selectingATreatment.go delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/java/selectingATreatment.java delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/js/selectingATreatment.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/php/selectingATreatment.php delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/python/selectingATreatment.py delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/react/usingUseTreatment.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/ruby/selectingATreatment.rb delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/swift/selectingATreatment.swift delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/vue/UsingTreatmentAlias.vue delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/_selecting-a-variable.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/dotnet/selectingAVariable.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/flutter/selectingAVariable.dart delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/go/selectingAVariable.go delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/java/selectingAVariable.java delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/js/selectingAVariable.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/php/selectingAVariable.php delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/python/selectingAVariable.py delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/react/inUseEffect.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/ruby/selectingAVariable.rb delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/swift/selectingAVariable.swift delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/vue/selectingAVariable.js create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/checking-variants-without-exposures.mdx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/_complete-example.mdx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/dotnet/completeExample.cs create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/flutter/completeExample.dart create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/go/completeExample.go create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/java/completeExample.java create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/js/completeExample.js create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/php/completeExample.php create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/python/completeExample.py create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/react/completeExample.jsx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/ruby/completeExample.rb create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/swift/completeExample.swift create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/vue/completeExample.js create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/complete-example/vue3/completeExample.js create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/config-api.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/_create-new-context-request.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/async.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/extraUnits.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/prefetchedData.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/refreshWithFreshData.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/refreshWithRefreshMethod.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/sync.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/async.dart delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/extraUnits.dart delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/refreshWithFreshData.dart delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/refreshWithRefresh.dart delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/sync.dart delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/withPrefetchedData.dart delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/async.go delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/extraUnits.go delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/refreshWithFreshData.go delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/refreshWithRefreshMethod.go delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/sync.go delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/async.java delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/extraUnits.java delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/preFetchedData.java delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/refreshWithFreshData.java delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/refreshWithRefreshMethod.java delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/sync.java delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/httpRequestCancellation.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/httpRequestTimeout.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/refreshWithFreshData.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/refreshWithRefreshMethod.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/usingAsyncAwait.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/usingRawPromises.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/withPreFetchedData.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/extraUnits.php delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/prefetchedData.php delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/refresh.php delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/sync.php delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/async.py delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/extraUnits.py delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/refreshWithFreshData.py delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/refreshWithRefreshMethod.py delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/sync.py delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/withPrefetchedData.py delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/forTernaryOperator.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/newContext.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/withABSmartly.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/createContext.rb delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/extraUnits.rb delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/extraUnitsAlt.rb delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/prefetchedData.rb delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/newContext.swift delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/refreshWithFreshData.swift delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/refreshWithRefreshMethod.swift delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/settingExtraUnits.swift delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/withPreFetchedData.swift delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/RefreshWithFreshData.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/initializeWithPrefetchedData.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/refreshWithRefreshMethod.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/manualRefresh.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/prefetched.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/refresh.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/sync.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/_custom-event-logger.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/_import-and-initialize.mdx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/manualSDKInstance.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/sdkInjection.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/startupCode.cs delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/flutter/import.dart delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/go/initialize.go delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/java/import.java delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/java/importForAndroid6.java delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/js/import.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/granularChoice.php delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/importAndInitialize.php delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/paramsInOrder.php delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/python/import.py delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/react/import.jsx delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/ruby/import.rb delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/swift/import.swift delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/vue/import.js delete mode 100644 docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/vue3/import.js create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/managing-the-context-lifecycle.mdx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/pre-fetching-context-data.mdx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/running-your-first-experiment.mdx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/targeting-and-audiences.mdx create mode 100644 docs/APIs-and-SDKs/SDK-Documentation/using-custom-fields.mdx rename docs/APIs-and-SDKs/SDK-Documentation/{Advanced/code-as-a-variant-variable.mdx => using-variables-as-code.mdx} (58%) diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/_category_.json b/docs/APIs-and-SDKs/SDK-Documentation/Advanced/_category_.json deleted file mode 100644 index 9ce123ad..00000000 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "label": "Advanced", - "position": 4, - "collapsed": false -} diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes.mdx b/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes.mdx deleted file mode 100644 index dac7a9bd..00000000 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -sidebar_position: 4 ---- - -import SettingContextAttributes from "./context-attributes/setting-context-attributes/_setting-context-attributes.mdx"; - -# Context Attributes - - diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments.mdx b/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments.mdx deleted file mode 100644 index e65eb00b..00000000 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -sidebar_position: 5 ---- - -import CustomAssignments from "./custom-assignments/_custom-assignments.mdx"; - -# Custom Assignments - - diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/_custom-assignments.mdx b/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/_custom-assignments.mdx deleted file mode 100644 index c5c76622..00000000 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/_custom-assignments.mdx +++ /dev/null @@ -1,249 +0,0 @@ -import Tabs from "@theme/Tabs"; -import TabItem from "@theme/TabItem"; -import CodeBlock from "@theme/CodeBlock"; - -import JsCustomAssignment from "!!raw-loader!./js/customAssignment.js"; -import JsCustomAssignments from "!!raw-loader!./js/customAssignments.js"; - -import PythonCustomAssignment from "!!raw-loader!./python/customAssignment.py"; -import PythonCustomAssignments from "!!raw-loader!./python/customAssignments.py"; - -import ReactCustomAssignment from "!!raw-loader!./react/customAssignment.js"; -import ReactCustomAssignments from "!!raw-loader!./react/customAssignments.js"; - -import SwiftCustomAssignment from "!!raw-loader!./swift/customAssignment.swift"; -import SwiftCustomAssignments from "!!raw-loader!./swift/customAssignments.swift"; - -import VueCustomAssignment from "!!raw-loader!./vue/customAssignment.js"; -import VueCustomAssignments from "!!raw-loader!./vue/customAssignments.js"; - -import JavaCustomAssignment from "!!raw-loader!./java/customAssignment.java"; -import JavaCustomAssignments from "!!raw-loader!./java/customAssignments.java"; - -import GoCustomAssignment from "!!raw-loader!./go/customAssignment.go"; -import GoCustomAssignments from "!!raw-loader!./go/customAssignments.go"; - -import DotNetCustomAssignment from "!!raw-loader!./dotnet/customAssignment.cs"; -import DotNetCustomAssignments from "!!raw-loader!./dotnet/customAssignments.cs"; - -import PHPCustomAssignment from "!!raw-loader!./php/customAssignment.php"; -import PHPCustomAssignments from "!!raw-loader!./php/customAssignments.php"; - -import RubyCustomAssignment from "!!raw-loader!./ruby/customAssignment.rb"; -import RubyCustomAssignments from "!!raw-loader!./ruby/customAssignments.rb"; - -import FlutterCustomAssignment from "!!raw-loader!./flutter/customAssignment.dart"; -import FlutterCustomAssignments from "!!raw-loader!./flutter/customAssignments.dart"; - -:::warning Warning -Events with custom assignments are **counted as eligible events** by the ABsmartly -statistics engines. If you are using these methods for development purposes -(to force a particular variant for yourself or somebody else on the team) it is -likely that you need the -[`context.override` methods](/docs/APIs-and-SDKs/SDK-Documentation/basic-usage#overriding-treatment-variants) -instead. -::: - - - - - -Sometimes it may be necessary to override the automatic selection of a variant. -For example, if you wish to have your variant chosen based on data from an -API call. This can be accomplished using the `context.customAssignment()` -method. - -{JsCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the `customAssignments` method. - -{JsCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a -variant. For example, if you wish to have your variant chosen based on -data from an API call. This can be accomplished using the -`set_custom_assignment()` method. - -{PythonCustomAssignment} - -If you are running multiple experiments and need to choose different -custom assignments for each one, you can do so using the -`set_custom_assignments()` method. - -{PythonCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a variant. -For example, if you wish to have your variant chosen based on data from an -API call. This can be accomplished using the `context.customAssignment()` -method. - -{ReactCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the `customAssignments` method. - -{ReactCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a variant. -For example, if you wish to have your variant chosen based on data from an -API call. This can be accomplished using the `context.setCustomAssignment()` -method. - -{SwiftCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the `setCustomAssignments` method. - -{SwiftCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a variant. -For example, if you wish to have your variant chosen based on data from an -API call. This can be accomplished using the `customAssignment()` -method. - -{VueCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the `customAssignments()` method. - -{VueCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a variant. -For example, if you wish to have your variant chosen based on data from an -API call. This can be accomplished using the `customAssignment()` -method. - -{VueCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the `customAssignments()` method. - -{VueCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a variant. -For example, if you wish to have your variant chosen based on data from an -API call. This can be accomplished using the `setCustomAssignment()` -method. - -{JavaCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the `setCustomAssignments()` method. - -{JavaCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a variant. -For example, if you wish to have your variant chosen based on data from an -API call. This can be accomplished using the `SetCustomAssignment()` -method. - -{GoCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the `SetCustomAssignments()` method. - -{GoCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a variant. -For example, if you wish to have your variant chosen based on data from an -API call. This can be accomplished using the `SetCustomAssignment()` -method. - -{DotNetCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the `SetCustomAssignments()` method. - -{DotNetCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a variant. -For example, if you wish to have your variant chosen based on data from an -API call. This can be accomplished using the `Context->setCustomAssignment()` -method. - -{PHPCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the -`Context->setCustomAssignments()` method. - -{PHPCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a -variant. For example, if you wish to have your variant chosen based on data -from an API call. This can be accomplished using the `set_custom_assignment()` -method. - -{RubyCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the `set_custom_assignments()` -method. - -{RubyCustomAssignments} - - - - - -Sometimes it may be necessary to override the automatic selection of a -variant. For example, if you wish to have your variant chosen based on data -from an API call. This can be accomplished using the `setCustomAssignment()` -method. - -{FlutterCustomAssignment} - -If you are running multiple experiments and need to choose different custom -assignments for each one, you can do so using the `setCustomAssignments()` -method. - -{FlutterCustomAssignments} - - - - - -:::info -These methods can be called before or after the context is ready. -::: diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize.mdx b/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize.mdx deleted file mode 100644 index 7a49ef30..00000000 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -sidebar_position: 7 ---- - -import Finalize from "./finalize/_finalize.mdx"; - -# Finalize - - diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish.mdx b/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish.mdx deleted file mode 100644 index bab4ec61..00000000 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -sidebar_position: 6 ---- - -import Publish from "./publish/_publish.mdx"; - -# Publish - - diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/_publish.mdx b/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/_publish.mdx deleted file mode 100644 index 0d4af4c0..00000000 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/_publish.mdx +++ /dev/null @@ -1,133 +0,0 @@ -import Tabs from "@theme/Tabs"; -import TabItem from "@theme/TabItem"; -import CodeBlock from "@theme/CodeBlock"; - -import JsPublish from "!!raw-loader!./js/publish.js"; - -import PythonPublish from "!!raw-loader!./python/publish.py"; - -import ReactPublish from "!!raw-loader!./react/publish.js"; - -import SwiftPublish from "!!raw-loader!./swift/publish.swift"; - -import VuePublish from "!!raw-loader!./vue/publish.js"; - -import JavaPublish from "!!raw-loader!./java/publish.java"; - -import GoPublish from "!!raw-loader!./go/publish.go"; - -import DotNetPublish from "!!raw-loader!./dotnet/publish.cs"; - -import PHPPublish from "!!raw-loader!./php/publish.php"; - -import RubyPublish from "!!raw-loader!./ruby/publish.rb"; - -import FlutterPublish from "!!raw-loader!./flutter/publish.dart"; - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly -collector before proceeding. To do this, you can explicitly call the `context.publish()` method. - -{JsPublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly collector, before proceeding. -You can explicitly call the `publish()` or `publish_async()` methods. - -{PythonPublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly collector before proceeding. To do this, you can explicitly call the `context.publish()` method. - -{ReactPublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly collector before proceeding. To do this, you can explicitly call the `context.publish()` method. - -{SwiftPublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly collector before proceeding. To do this, you can explicitly call the `publish()` method. - -{VuePublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly collector before proceeding. To do this, you can explicitly call the `publish()` method. - -{VuePublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly collector before proceeding. To do this, you can explicitly call the `context.publish()` or -`context.publishAsync()` methods. - -{JavaPublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly collector before proceeding. To do this, you can explicitly call the `Publish()` or -`PublishAsync()` methods. - -{GoPublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the -ABsmartly collector before proceeding. To do this, you can explicitly call the -`Publish()` or `PublishAsync()` methods. - -{DotNetPublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly collector, before proceeding. You can explicitly call the `Context->publish()` method. - -{PHPPublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly collector, before proceeding. You can explicitly call the `publish()` -methods. - -{RubyPublish} - - - - - -Sometimes it is necessary to ensure all events have been published to the ABsmartly collector, before proceeding. You can explicitly call the `publish()` -method. - -{FlutterPublish} - - - - diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals.mdx b/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals.mdx deleted file mode 100644 index 3ee6be86..00000000 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -sidebar_position: 8 ---- - -import TrackingGoals from "./tracking-goals/_tracking-goals.mdx"; - -# Tracking Goals - - diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/using-custom-fields-in-your-code.mdx b/docs/APIs-and-SDKs/SDK-Documentation/Advanced/using-custom-fields-in-your-code.mdx deleted file mode 100644 index 866253c2..00000000 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/using-custom-fields-in-your-code.mdx +++ /dev/null @@ -1,73 +0,0 @@ -# Custom Fields in Code - -In the [Platform Settings on the Web Console](/docs/web-console-docs/configuration/settings#platform-settings), you can create -custom fields that are available to the SDKs. These custom fields can be used to add additional logic to your -A/B experiments. - -:::info -This feature is currently supported by the following SDKs: -- Java -- Javascript -- Swift -- Ruby -::: - -## An Example - -Let's say you wish to override an experiment's allocation to a specific variant if they are a member of your development team. - -### Creating a Custom Field - -Checkout the [docs on creating a custom field](/docs/web-console-docs/configuration/settings#custom-fields) for more information on -adding a field to your experiment creation form, but for this example, we'll create a field with -the following properties: -- **Name**: `Developers' variant` -- **Type**: `number` -- **Help Text**: `The variant to allocate to developers when they are testing the app in production.` -- **Default Value**: `1` -- **Field Required**: `true` -- **Available?**: `true` -- **Field Key**: `developer_variant` -- **Section**: `Description` - -:::note -You may wish to [create a custom section](/docs/web-console-docs/configuration/settings#custom-fields) for this field. -::: - -### Using the Custom Field - -Now, when creating an experiment, you will see the custom field in the metadata section with a default value of `1`. -If your experiment has more than one variant, you could change it per experiment to be `2` or `3`, or you could change -it to `0`, if you wish for developers to only see the control variant. - -Now, in your app, you can pull the custom field value from the SDK context and use it to override the -`context.treatment()` call. Here, we are assuming that the app's `user` object has an `isDeveloper` property. - -```ts -const context = sdk.createContext(...); -await context.ready(); - -const experimentNames = context.experiments(); -for (const experimentName of experimentNames) { - const developerVariant = context.customFieldValue(experimentName, "developer_variant"); - - if (developerVariant != null && user.isDeveloper) { - context.override(experimentName, developerVariant); - } -} -``` - -This code gets the list of experiment names, gets the `developer_variant` custom field value for each experiment, and -if the current user is a developer, it overrides the experiment allocation to the variant that was set in the Web -Console. If the user is not a developer, the experiment will run as normal. The `developer_variant` can also be -edited on the Web Console to change the variant that developers see. - -:::caution -Overriding an experiment allocation will not count the user towards the experiment data. -To learn more about overrides, have a look at the [overrides SDK documentation](/docs/APIs-and-SDKs/SDK-Documentation/basic-usage#overriding-treatment-variants). -::: - -## Conclusion - -This is just one example of how custom fields can be used to add logic to your experiments, but there are many more! -If you have any questions, please feel free reach out to us on Slack or via email. \ No newline at end of file diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_category_.json b/docs/APIs-and-SDKs/SDK-Documentation/_category_.json index 0b4f367c..2bdacffe 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/_category_.json +++ b/docs/APIs-and-SDKs/SDK-Documentation/_category_.json @@ -1,5 +1,6 @@ { - "position": 1, + "label": "SDK Guide", + "position": 2, "collapsible": true, "collapsed": true } diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_create-context-basic.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_create-context-basic.mdx new file mode 100644 index 00000000..268c7f57 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_create-context-basic.mdx @@ -0,0 +1,209 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + + +```js +const context = sdk.createContext({ + units: { + user_id: "user-12345", + }, +}); + +await context.ready(); +``` + +
+Using promises instead of async/await + +If you're not in an async context, you can use the promise-based API: + +```js +const context = sdk.createContext({ + units: { + user_id: "user-12345", + }, +}); + +context.ready().then(() => { + const variant = context.treatment("experiment_name"); +}); +``` + +
+ +
+ + + +```python +context_config = ContextConfig() +context_config.units = {"user_id": "user-12345"} + +ctx = sdk.create_context(context_config) +ctx.wait_until_ready() +``` + + + + + +The `` Provider already created a context during initialisation. Access it +in any child component with the `useABSmartly()` hook: + +```jsx +import { useABSmartly } from "@absmartly/react-sdk"; + +function MyComponent() { + const { context } = useABSmartly(); + // context is ready to use +} +``` + +
+Using class components + +If your codebase uses class components, the SDK also exports a `withABSmartly` +higher-order component that provides the context as a prop: + +```jsx +import { withABSmartly } from "@absmartly/react-sdk"; + +function App({ absmartly }) { + const { context } = absmartly; + + return
{/* Your app content */}
; +} + +export default withABSmartly(App); +``` + +
+ +
+ + + +```swift +let contextConfig = ContextConfig() +contextConfig.setUnit(unitType: "user_id", uid: "user-12345") + +let context = sdk.createContext(config: contextConfig) +context.waitUntilReady() +``` + + + + + +The plugin already created a context during initialisation. Access it in any component +via `this.$absmartly`: + +```js +export default { + mounted() { + const treatment = this.$absmartly.treatment("experiment_name"); + }, +}; +``` + + + + + +The plugin already created a context during initialisation. Access it in any component +via `this.$absmartly`: + +```js +export default { + mounted() { + const treatment = this.$absmartly.treatment("experiment_name"); + }, +}; +``` + + + + + +```java +final ContextConfig contextConfig = ContextConfig.create() + .setUnit("user_id", "user-12345"); + +final Context context = sdk.createContext(contextConfig) + .waitUntilReady(); +``` + + + + + +```go +contextConfig := ContextConfig{ + Units_: map[string]string{ + "user_id": "user-12345", + }, +} + +ctx := sdk.CreateContext(contextConfig) +ctx.WaitUntilReady() +``` + + + + + +```csharp +var config = new ContextConfig() + .SetUnit("user_id", "user-12345"); + +var context = await sdk.CreateContextAsync(config); +``` + + + + + +```php +$contextConfig = new ContextConfig(); +$contextConfig->setUnit('user_id', 'user-12345'); + +$context = $sdk->createContext($contextConfig); +``` + + + + + +```ruby +context_config = Absmartly.create_context_config +context_config.unit("user_id", "user-12345") + +context = Absmartly.create_context(context_config) +``` + + + + + +```dart +final ContextConfig contextConfig = ContextConfig.create() + .setUnit("user_id", "user-12345"); + +final Context? context = sdk.createContext(contextConfig) + .waitUntilReady(); +``` + + + +
+ +:::info +The `user_id` above is just an example. You can use any unit type that you've configured +in your Web Console under Settings > Units (e.g. `session_id`, `device_id`, `email`). +Pass all the units you have available for the current user. If you're not sure which +ones to use, check Settings > Units in the Web Console. You'll see how these connect +to experiments on the [next page](./running-your-first-experiment). +::: diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_initialize-basic.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_initialize-basic.mdx new file mode 100644 index 00000000..57f97773 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_initialize-basic.mdx @@ -0,0 +1,527 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + + +```js +import absmartly from "@absmartly/javascript-sdk"; + +const sdk = new absmartly.SDK({ + endpoint: "https://your-company.absmartly.io/v1", + apiKey: "YOUR-API-KEY", + environment: "production", + application: "website", +}); +``` + + + + + +The Python SDK separates client and SDK configuration so you can swap the HTTP +client implementation if needed. + +```python +client_config = ClientConfig() +client_config.endpoint = "https://your-company.absmartly.io/v1" +client_config.api_key = "YOUR-API-KEY" +client_config.application = "website" +client_config.environment = "production" + +sdk_config = ABSmartlyConfig() +sdk_config.client = Client(client_config, DefaultHTTPClient(DefaultHTTPClientConfig())) +sdk = ABSmartly(sdk_config) +``` + + + + + +The React SDK wraps your app in a Provider that handles both SDK initialisation and +context creation in one step: + +```jsx +import ABSmartly from "@absmartly/react-sdk"; + +function App() { + return ( + + {/* Your app content */} + + ); +} +``` + +:::note +The `` Provider creates a context automatically. You can skip ahead to +[Next steps](#next-steps) and access the context in any child component with the +`useABSmartly()` hook. +::: + + + + + +```swift +import ABSmartly + +let clientConfig = ClientConfig( + apiKey: "YOUR-API-KEY", + application: "website", + endpoint: "https://your-company.absmartly.io/v1", + environment: "production") + +let client = try DefaultClient(config: clientConfig) +let sdkConfig = ABSmartlyConfig(client: client) +let sdk = try ABSmartlySDK(config: sdkConfig) +``` + + + + + +The Vue2 SDK initialises as a plugin, creating both the SDK and a context in one step. +This makes the `$absmartly` extension available in every Vue instance. + +```js +import absmartly from "@absmartly/vue2-sdk"; + +Vue.use(absmartly.ABSmartlyVue, { + sdkOptions: { + endpoint: "https://your-company.absmartly.io/v1", + apiKey: "YOUR-API-KEY", + environment: "production", + application: "website", + }, + context: { + units: { + user_id: "user-12345", + }, + }, +}); +``` + +:::note +The plugin creates a context automatically. You can skip ahead to +[Next steps](#next-steps) and access it via `this.$absmartly` in any component. +::: + +
+Passing attributes and overrides at init + +You can also pass context attributes and overrides during plugin initialisation: + +```js +Vue.use(absmartly.ABSmartlyVue, { + sdkOptions: { + endpoint: "https://your-company.absmartly.io/v1", + apiKey: "YOUR-API-KEY", + environment: "production", + application: "website", + }, + context: { + units: { + user_id: "user-12345", + }, + }, + attributes: { + user_agent: navigator.userAgent, + }, + overrides: { + exp_test_development: 1, + }, +}); +``` + +
+ +
+Using pre-fetched context data + +If you have already fetched context data on the server (see +[Pre-Fetching Context Data](./pre-fetching-context-data)), you can pass it directly +to avoid an extra network request: + +```js +Vue.use(absmartly.ABSmartlyVue, { + sdkOptions: { + endpoint: "https://your-company.absmartly.io/v1", + apiKey: "YOUR-API-KEY", + environment: "production", + application: "website", + }, + context: { + units: { + user_id: "user-12345", + }, + }, + data: prefetchedContext, +}); +``` + +
+ +
+ + + +The Vue3 SDK initialises as a plugin, creating both the SDK and a context in one step. +This makes the `$absmartly` extension available in every Vue instance. + +```js +import absmartly from "@absmartly/vue3-sdk"; + +app.use(absmartly.ABSmartlyVue, { + sdkOptions: { + endpoint: "https://your-company.absmartly.io/v1", + apiKey: "YOUR-API-KEY", + environment: "production", + application: "website", + }, + context: { + units: { + user_id: "user-12345", + }, + }, +}); +``` + +:::note +The plugin creates a context automatically. You can skip ahead to +[Next steps](#next-steps) and access it via `this.$absmartly` in any component. +::: + +
+Passing attributes and overrides at init + +You can also pass context attributes and overrides during plugin initialisation: + +```js +app.use(absmartly.ABSmartlyVue, { + sdkOptions: { + endpoint: "https://your-company.absmartly.io/v1", + apiKey: "YOUR-API-KEY", + environment: "production", + application: "website", + }, + context: { + units: { + user_id: "user-12345", + }, + }, + attributes: { + user_agent: navigator.userAgent, + }, + overrides: { + exp_test_development: 1, + }, +}); +``` + +
+ +
+Using pre-fetched context data + +If you have already fetched context data on the server (see +[Pre-Fetching Context Data](./pre-fetching-context-data)), you can pass it directly +to avoid an extra network request: + +```js +app.use(absmartly.ABSmartlyVue, { + sdkOptions: { + endpoint: "https://your-company.absmartly.io/v1", + apiKey: "YOUR-API-KEY", + environment: "production", + application: "website", + }, + context: { + units: { + user_id: "user-12345", + }, + }, + data: prefetchedContext, +}); +``` + +
+ +
+ + + +```java +final ClientConfig clientConfig = ClientConfig.create() + .setEndpoint("https://your-company.absmartly.io/v1") + .setAPIKey("YOUR-API-KEY") + .setApplication("website") + .setEnvironment("production"); + +final Client absmartlyClient = Client.create(clientConfig); + +final ABSmartlyConfig sdkConfig = ABSmartlyConfig.create() + .setClient(absmartlyClient); + +final ABSmartly sdk = ABSmartly.create(sdkConfig); +``` + +
+Targeting Android 6.0 or earlier + +When targeting Android 6.0 or earlier, set the default Java Security Provider +for SSL to Conscrypt by creating the Client instance as follows: + +```java +import com.absmartly.sdk.*; +import org.conscrypt.Conscrypt; + +final ClientConfig clientConfig = ClientConfig.create() + .setEndpoint("https://your-company.absmartly.io/v1") + .setAPIKey("YOUR-API-KEY") + .setApplication("website") + .setEnvironment("production"); + +final DefaultHTTPClientConfig httpClientConfig = DefaultHTTPClientConfig.create() + .setSecurityProvider(Conscrypt.newProvider()); + +final DefaultHTTPClient httpClient = DefaultHTTPClient.create(httpClientConfig); + +final Client absmartlyClient = Client.create(clientConfig, httpClient); + +final ABSmartlyConfig sdkConfig = ABSmartlyConfig.create() + .setClient(absmartlyClient); + +final ABSmartly sdk = ABSmartly.create(sdkConfig); +``` + +
+ +
+ + + +```go +clientConfig := ClientConfig{ + Endpoint_: "https://your-company.absmartly.io/v1", + ApiKey_: "YOUR-API-KEY", + Application_: "website", + Environment_: "production", +} + +sdkConfig := ABSmartlyConfig{Client_: CreateDefaultClient(clientConfig)} +sdk := Create(sdkConfig) +``` + + + + + +If your project uses dependency injection, register the SDK in your startup code: + +```csharp +builder.Services.AddABSmartly( + builder.Configuration.GetSection("ABSmartly"), + HttpClientConfig.CreateDefault()); +``` + +```json title="appsettings.json" +{ + "ABSmartly": { + "Environment": "production", + "Application": "website", + "Endpoint": "https://your-company.absmartly.io/v1", + "ApiKey": "YOUR-API-KEY" + } +} +``` + +The `ABSdk` instance is registered as a singleton and can be injected into any controller +or service: + +```csharp +[ApiController] +[Route("[controller]")] +public class Test : ControllerBase +{ + private readonly ABSdk _abSdk; + + public Test(ABSdk abSdk) + { + _abSdk = abSdk; + } +} +``` + +
+Advanced DI configuration (Polly, custom HTTP clients) + +The `AddABSmartly` extension method also allows you to configure HTTP connection settings, +inject custom implementations of context-specific services, and configure additional HTTP +request policies using [Polly](https://github.com/App-vNext/Polly). + +If you need a custom `IHttpClientFactory` implementation, make sure it creates named +`IHttpClient` instances with the name `ABSmartlySDK.HttpClient` (available as the static +field `ABSdk.HttpClientName`). + +
+ +
+Manual instantiation (without dependency injection) + +```csharp +var serviceProvider = new ServiceCollection() + .AddHttpClient() + .BuildServiceProvider(); +var httpClientFactory = serviceProvider.GetService(); + +var sdk = new ABSdk( + new ABSdkHttpClientFactory(httpClientFactory), + new ABSmartlyServiceConfiguration + { + Environment = "production", + Application = "website", + Endpoint = "https://your-company.absmartly.io/v1", + ApiKey = "YOUR-API-KEY" + }); +``` + +
+ +
+ + + +```php +use \ABSmartly\SDK\SDK; + +$sdk = SDK::createWithDefaults( + endpoint: 'https://your-company.absmartly.io/v1', + apiKey: 'YOUR-API-KEY', + environment: 'production', + application: 'website', +); +``` + +:::note +The example above uses named parameters (PHP 8.0+). On PHP 7.4, pass the +parameters in order instead: + +```php +$sdk = SDK::createWithDefaults( + 'https://your-company.absmartly.io/v1', $apiKey, $environment, $application, +); +``` +::: + +
+Granular component setup (custom event logger, etc.) + +The `createWithDefaults` shortcut works for most cases. If you need finer control +over individual components (for example, to inject a custom event logger), build +the SDK from its parts instead: + +```php +use ABSmartly\SDK\Client\ClientConfig; +use ABSmartly\SDK\Client\Client; +use ABSmartly\SDK\Config; +use ABSmartly\SDK\SDK; +use ABSmartly\SDK\Context\ContextConfig; +use ABSmartly\SDK\Context\ContextEventLoggerCallback; + +$clientConfig = new ClientConfig( + 'https://your-company.absmartly.io/v1', + 'YOUR-API-KEY', + 'website', + 'production' +); +$client = new Client($clientConfig); +$config = new Config($client); + +$sdk = new SDK($config); + +$contextConfig = new ContextConfig(); +$contextConfig->setEventLogger(new ContextEventLoggerCallback( + function (string $event, ?object $data) { + // Custom callback + } +)); + +$context = $sdk->createContext($contextConfig); +``` + +
+ +
+ + + +```ruby +Absmartly.configure_client do |config| + config.endpoint = "https://your-company.absmartly.io/v1" + config.api_key = "YOUR-API-KEY" + config.application = "website" + config.environment = "production" +end +``` + + + + + +```dart +final ClientConfig clientConfig = ClientConfig() + ..setEndpoint("https://your-company.absmartly.io/v1") + ..setAPIKey("YOUR-API-KEY") + ..setApplication("website") + ..setEnvironment("production"); + +final ABSmartlyConfig sdkConfig = ABSmartlyConfig.create() + .setClient(Client.create(clientConfig)); +final ABSmartly sdk = ABSmartly(sdkConfig); +``` + + + +
+ +Every SDK requires four options: + +| Option | Description | +|:--|:--| +| `endpoint` | Your API endpoint URL. Typically `https://your-company.absmartly.io/v1` | +| `apiKey` | Found in Settings > API Keys in the Web Console | +| `environment` | Must match an environment configured in the Web Console (e.g. `"production"`, `"development"`) | +| `application` | Must match an application configured in the Web Console | + +
+Optional configuration + +Beyond the four required options, every SDK also accepts these optional settings: + +| Option | Default | Description | +|:--|:--|:--| +| `retries` | `5` | Number of retries before the SDK stops trying to connect | +| `timeout` | `3000` ms | How long to wait for a response before giving up | +| `eventLogger` | none | Callback that fires on SDK events (exposures, goals, errors). See the [custom event logger](#using-a-custom-event-logger) section below. | + +:::info Language-specific differences +Most SDKs use the names and defaults above. A few differ: +- **Python**: `max_retries`, `connection_timeout` (in seconds, not milliseconds), `context_event_logger` +- **Swift**: `retries` defaults to `3` (not `5`). Timeouts are in seconds, not milliseconds. +- **PHP**: `retries` and `timeout` are `int` types. The event logger accepts a `ContextEventLoggerCallback` or any `ContextEventLogger` implementation. +- **Flutter/Dart**: Does not expose `retries`, `timeout`, or `eventLogger` as top-level options. These are configured through the client config. +::: + +
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_selecting-a-treatment-basic.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_selecting-a-treatment-basic.mdx new file mode 100644 index 00000000..14686646 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_selecting-a-treatment-basic.mdx @@ -0,0 +1,140 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; +import CodeBlock from "@theme/CodeBlock"; + +import JsSelectingATreatment from "!!raw-loader!./_shared/selecting-a-treatment/js/selectingATreatment.js"; +import PythonSelectingATreatment from "!!raw-loader!./_shared/selecting-a-treatment/python/selectingATreatment.py"; +import ReactUsingUseTreatment from "!!raw-loader!./_shared/selecting-a-treatment/react/usingUseTreatment.js"; +import ReactSelectingATreatment from "!!raw-loader!./_shared/selecting-a-treatment/react/selectingATreatment.js"; +import ReactUsingTernaryOperator from "!!raw-loader!./_shared/selecting-a-treatment/react/usingTernaryOperator.js"; +import SwiftSelectingATreatment from "!!raw-loader!./_shared/selecting-a-treatment/swift/selectingATreatment.swift"; +import VueUsingTreatmentAlias from "!!raw-loader!./_shared/selecting-a-treatment/vue/UsingTreatmentAlias.vue"; +import VueUsingTreatmentIndex from "!!raw-loader!./_shared/selecting-a-treatment/vue/UsingTreatmentIndex.vue"; +import VueUsingOnlyDefaultSlot from "!!raw-loader!./_shared/selecting-a-treatment/vue/UsingOnlyDefaultSlot.vue"; +import JavaSelectingATreatment from "!!raw-loader!./_shared/selecting-a-treatment/java/selectingATreatment.java"; +import GoSelectingATreatment from "!!raw-loader!./_shared/selecting-a-treatment/go/selectingATreatment.go"; +import DotNetSelectingATreatment from "!!raw-loader!./_shared/selecting-a-treatment/dotnet/selectingATreatment.cs"; +import PHPSelectingATreatment from "!!raw-loader!./_shared/selecting-a-treatment/php/selectingATreatment.php"; +import RubySelectingATreatment from "!!raw-loader!./_shared/selecting-a-treatment/ruby/selectingATreatment.rb"; +import FlutterSelectingATreatment from "!!raw-loader!./_shared/selecting-a-treatment/flutter/selectingATreatment.dart"; + + + + + +{JsSelectingATreatment} + + + + + +{PythonSelectingATreatment} + + + + + +{ReactUsingUseTreatment} + +
+Alternative: declarative component patterns + +The React SDK also provides component-based approaches. The `Treatment` and +`TreatmentVariant` components let you declare variants without conditional logic. +You can pass variant letters (`"A"`, `"B"`) or numbers: + +{ReactSelectingATreatment} + +For more control, `TreatmentFunction` gives you the variant as a render prop: + +{ReactUsingTernaryOperator} + +
+ +
+ + + +{SwiftSelectingATreatment} + + + + + +{VueUsingTreatmentAlias} + +
+Alternative slot patterns + +**By variant index** -- use slot names `#0`, `#1`, `#2` to match variant numbers +directly. Each slot receives `treatment`, `ready`, and `failed` as scoped properties: + +{VueUsingTreatmentIndex} + +**Default slot only** -- use a single default slot and handle the branching yourself +with the `treatment`, `ready`, and `failed` scoped properties: + +{VueUsingOnlyDefaultSlot} + +
+ +
+ + + +{VueUsingTreatmentAlias} + +
+Alternative slot patterns + +**By variant index** -- use slot names `#0`, `#1`, `#2` to match variant numbers +directly. Each slot receives `treatment`, `ready`, and `failed` as scoped properties: + +{VueUsingTreatmentIndex} + +**Default slot only** -- use a single default slot and handle the branching yourself +with the `treatment`, `ready`, and `failed` scoped properties: + +{VueUsingOnlyDefaultSlot} + +
+ +
+ + + +{JavaSelectingATreatment} + + + + + +{GoSelectingATreatment} + + + + + +{DotNetSelectingATreatment} + + + + + +{PHPSelectingATreatment} + + + + + +{RubySelectingATreatment} + + + + + +{FlutterSelectingATreatment} + + + +
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_selecting-a-variable-basic.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_selecting-a-variable-basic.mdx new file mode 100644 index 00000000..9a1936ce --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_selecting-a-variable-basic.mdx @@ -0,0 +1,91 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; +import CodeBlock from "@theme/CodeBlock"; + +import JsSelectingAVariable from "!!raw-loader!./_shared/selecting-a-variable/js/selectingAVariable.js"; +import PythonSelectingAVariable from "!!raw-loader!./_shared/selecting-a-variable/python/selectingAVariable.py"; +import ReactUsingUseEffect from "!!raw-loader!./_shared/selecting-a-variable/react/inUseEffect.js"; +import SwiftSelectingAVariable from "!!raw-loader!./_shared/selecting-a-variable/swift/selectingAVariable.swift"; +import VueSelectingAVariable from "!!raw-loader!./_shared/selecting-a-variable/vue/selectingAVariable.js"; +import JavaSelectingAVariable from "!!raw-loader!./_shared/selecting-a-variable/java/selectingAVariable.java"; +import GoSelectingAVariable from "!!raw-loader!./_shared/selecting-a-variable/go/selectingAVariable.go"; +import DotNetSelectingAVariable from "!!raw-loader!./_shared/selecting-a-variable/dotnet/selectingAVariable.cs"; +import PHPSelectingAVariable from "!!raw-loader!./_shared/selecting-a-variable/php/selectingAVariable.php"; +import RubySelectingAVariable from "!!raw-loader!./_shared/selecting-a-variable/ruby/selectingAVariable.rb"; +import FlutterSelectingAVariable from "!!raw-loader!./_shared/selecting-a-variable/flutter/selectingAVariable.dart"; + + + + + +{JsSelectingAVariable} + + + + + +{PythonSelectingAVariable} + + + + + +{ReactUsingUseEffect} + + + + + +{SwiftSelectingAVariable} + + + + + +{VueSelectingAVariable} + + + + + +{VueSelectingAVariable} + + + + + +{JavaSelectingAVariable} + + + + + +{GoSelectingAVariable} + + + + + +{DotNetSelectingAVariable} + + + + + +{PHPSelectingAVariable} + + + + + +{RubySelectingAVariable} + + + + + +{FlutterSelectingAVariable} + + + + diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/_config-api.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/_config-api.mdx similarity index 82% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/_config-api.mdx rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/_config-api.mdx index 2fa0e28a..7ecba98e 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/_config-api.mdx +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/_config-api.mdx @@ -7,15 +7,13 @@ import JsLanguagesConfig from "!!raw-loader!./js/languagesConfig.js"; import JsGetVariantVariableKeys from "!!raw-loader!./js/getVariantVariableKeys.js"; import JsMergeTranslationConfigs from "!!raw-loader!./js/mergeTranslationConfigs.js"; -#### Config API - If you use configuration files to change different aspects of your application, then you can use the Config API to greatly improve your workflow and save a lot of coding time. {JsMergeConfig} -##### Basic Example +### Basic Example Let's say you use a configuration file to change various parameters in your application: @@ -55,8 +53,8 @@ For each user the SDK receives a payload similar to this: "name": "homepage_cta", "variant": 0, "config": { - "button.cta": "Click here", - "hero_image": "http://cdn.com/img1.png" + "button.cta": "Click me", + "hero_image": "https://cdn.com/img1.png" } } ] @@ -80,14 +78,17 @@ now, the correct experiments will be triggered when a value is being overridden by said experiment. This greatly simplifies the process of setting up experiments and cleaning up -your code. If, at somepoint, a large part of the code is setup in this way +your code. If, at some point, a large part of the code is set up in this way you will be able to create different experiments without touching a single line of code. -##### Translations Example +### Translations Example + +This is an advanced pattern. If you don't need multi-language support, the basic +example above is all you need. -Let's look at a slightly more complex example where you have to run an experiment -whilst accomodating for multiple languages. +Let's look at a more complex example where you run an experiment whilst +accommodating multiple languages. Here, we have a languagesConfig.js file: @@ -118,24 +119,12 @@ The `translationVariations` variable would then be returned as something like: {JsMergeTranslationConfigs} -...which would return an object similar to: +...which would return an object with getter properties (shown here as pseudocode): -```js +``` { - get header: () => { - exp.treatment("experiment1"); - return { - en: "Our beautiful header!", - nl: "Onze mooie kop!", - }; - } - get call_to_action1: () => { - exp.treatment("experiment2"); - return { - en: "Click here!", - nl: "Klik Hier" - }; - } + header: -> calls treatment("experiment1"), returns { en: "Our beautiful header!", nl: "Onze mooie kop!" } + call_to_action1: -> calls treatment("experiment2"), returns { en: "Click here!", nl: "Klik Hier" } } ``` diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/configChangeParameters.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/configChangeParameters.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/configChangeParameters.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/configChangeParameters.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/getVariantVariableKeys.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/getVariantVariableKeys.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/getVariantVariableKeys.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/getVariantVariableKeys.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/languagesConfig.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/languagesConfig.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/languagesConfig.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/languagesConfig.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/mergeConfig.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/mergeConfig.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/mergeConfig.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/mergeConfig.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/mergeTranslationConfigs.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/mergeTranslationConfigs.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/mergeTranslationConfigs.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/mergeTranslationConfigs.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/returnedConfig.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/returnedConfig.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/config-api/js/returnedConfig.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/config-api/js/returnedConfig.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/_setting-context-attributes.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/_setting-context-attributes.mdx similarity index 84% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/_setting-context-attributes.mdx rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/_setting-context-attributes.mdx index cd7bc980..d525f30f 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/_setting-context-attributes.mdx +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/_setting-context-attributes.mdx @@ -26,15 +26,14 @@ import RubySetAttributes from "!!raw-loader!./ruby/setAttributes.rb"; import FlutterSetAttributes from "!!raw-loader!./flutter/setAttributes.dart"; -Attributes are used to pass meta-data about the user and/or the request. They -can be used later in the Web Console to create segments or audiences. They can -be set using the `attribute()` or `attributes()` methods, before or after the -context is ready. - -One of the most useful and commonly used attributes, is the `user_agent` attribute -which, when passed to the SDK, will be split up into multiple attributes that -can be used to target specific browsers or devices in the Web Console. You can read -more about how this works in [the Segments section of the Dashboard Settings docs](/docs/web-console-docs/configuration/settings#segments). +Set attributes using the `attribute()` or `attributes()` methods, before or +after the context is ready. + +A particularly useful attribute is `user_agent`. When you pass it to the SDK, +ABsmartly automatically parses it into browser, OS, and device attributes that +you can use for targeting in the Web Console. See +[Segments in Dashboard Settings](/docs/web-console-docs/configuration/settings#segments) +for details. diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/dotnet/setAttributes.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/dotnet/setAttributes.cs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/dotnet/setAttributes.cs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/dotnet/setAttributes.cs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/flutter/setAttributes.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/flutter/setAttributes.dart similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/flutter/setAttributes.dart rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/flutter/setAttributes.dart diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/go/setAttributes.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/go/setAttributes.go similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/go/setAttributes.go rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/go/setAttributes.go diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/java/setAttributes.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/java/setAttributes.java similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/java/setAttributes.java rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/java/setAttributes.java diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/js/setAttributes.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/js/setAttributes.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/js/setAttributes.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/js/setAttributes.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/php/setAttributes.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/php/setAttributes.php similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/php/setAttributes.php rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/php/setAttributes.php diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/python/setAttributes.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/python/setAttributes.py similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/python/setAttributes.py rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/python/setAttributes.py diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/react/setAttributes.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/react/setAttributes.js similarity index 92% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/react/setAttributes.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/react/setAttributes.js index 1a2c811f..6a33b2be 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/react/setAttributes.js +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/react/setAttributes.js @@ -1,3 +1,5 @@ +const { context } = useABSmartly(); + context.attributes({ customer_time: user.created > new Date().getTime() - 24 * 60 * 60 * 1000 diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/react/setAttributesAsProps.tsx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/react/setAttributesAsProps.tsx similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/react/setAttributesAsProps.tsx rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/react/setAttributesAsProps.tsx diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/ruby/setAttributes.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/ruby/setAttributes.rb similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/ruby/setAttributes.rb rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/ruby/setAttributes.rb diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/swift/setAttributes.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/swift/setAttributes.swift similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/swift/setAttributes.swift rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/swift/setAttributes.swift diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/vue/SetAttributes.vue b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/vue/SetAttributes.vue similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/vue/SetAttributes.vue rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/vue/SetAttributes.vue diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/vue/setAttributes.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/vue/setAttributes.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/context-attributes/setting-context-attributes/vue/setAttributes.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/context-attributes/vue/setAttributes.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/_custom-assignments.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/_custom-assignments.mdx new file mode 100644 index 00000000..73dd6066 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/_custom-assignments.mdx @@ -0,0 +1,172 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; +import CodeBlock from "@theme/CodeBlock"; + +import JsCustomAssignment from "!!raw-loader!./js/customAssignment.js"; +import JsCustomAssignments from "!!raw-loader!./js/customAssignments.js"; + +import PythonCustomAssignment from "!!raw-loader!./python/customAssignment.py"; +import PythonCustomAssignments from "!!raw-loader!./python/customAssignments.py"; + +import ReactCustomAssignment from "!!raw-loader!./react/customAssignment.js"; +import ReactCustomAssignments from "!!raw-loader!./react/customAssignments.js"; + +import SwiftCustomAssignment from "!!raw-loader!./swift/customAssignment.swift"; +import SwiftCustomAssignments from "!!raw-loader!./swift/customAssignments.swift"; + +import VueCustomAssignment from "!!raw-loader!./vue/customAssignment.js"; +import VueCustomAssignments from "!!raw-loader!./vue/customAssignments.js"; + +import JavaCustomAssignment from "!!raw-loader!./java/customAssignment.java"; +import JavaCustomAssignments from "!!raw-loader!./java/customAssignments.java"; + +import GoCustomAssignment from "!!raw-loader!./go/customAssignment.go"; +import GoCustomAssignments from "!!raw-loader!./go/customAssignments.go"; + +import DotNetCustomAssignment from "!!raw-loader!./dotnet/customAssignment.cs"; +import DotNetCustomAssignments from "!!raw-loader!./dotnet/customAssignments.cs"; + +import PHPCustomAssignment from "!!raw-loader!./php/customAssignment.php"; +import PHPCustomAssignments from "!!raw-loader!./php/customAssignments.php"; + +import RubyCustomAssignment from "!!raw-loader!./ruby/customAssignment.rb"; +import RubyCustomAssignments from "!!raw-loader!./ruby/customAssignments.rb"; + +import FlutterCustomAssignment from "!!raw-loader!./flutter/customAssignment.dart"; +import FlutterCustomAssignments from "!!raw-loader!./flutter/customAssignments.dart"; + +Set a variant for a single experiment, or use the batch method for multiple +experiments at once. Both can be called before or after the context is ready. + + + + + +{JsCustomAssignment} + +For multiple experiments: + +{JsCustomAssignments} + + + + + +{PythonCustomAssignment} + +For multiple experiments: + +{PythonCustomAssignments} + + + + + +{ReactCustomAssignment} + +For multiple experiments: + +{ReactCustomAssignments} + + + + + +{SwiftCustomAssignment} + +For multiple experiments: + +{SwiftCustomAssignments} + + + + + +{VueCustomAssignment} + +For multiple experiments: + +{VueCustomAssignments} + + + + + +{VueCustomAssignment} + +For multiple experiments: + +{VueCustomAssignments} + + + + + +{JavaCustomAssignment} + +For multiple experiments: + +{JavaCustomAssignments} + + + + + +{GoCustomAssignment} + +For multiple experiments: + +{GoCustomAssignments} + + + + + +{DotNetCustomAssignment} + +For multiple experiments: + +{DotNetCustomAssignments} + + + + + +{PHPCustomAssignment} + +For multiple experiments: + +{PHPCustomAssignments} + + + + + +{RubyCustomAssignment} + +For multiple experiments: + +{RubyCustomAssignments} + + + + + +{FlutterCustomAssignment} + +For multiple experiments: + +{FlutterCustomAssignments} + + + + + +:::warning +Events with custom assignments are **counted as eligible events** by the ABsmartly +statistics engines. If you are using these methods for development purposes +(to force a particular variant for yourself or somebody else on the team) you +probably need +[overrides](/docs/APIs-and-SDKs/SDK-Documentation/targeting-and-audiences#overriding-variants-for-development-and-qa) +instead. +::: diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/dotnet/customAssignment.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/dotnet/customAssignment.cs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/dotnet/customAssignment.cs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/dotnet/customAssignment.cs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/dotnet/customAssignments.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/dotnet/customAssignments.cs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/dotnet/customAssignments.cs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/dotnet/customAssignments.cs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/flutter/customAssignment.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/flutter/customAssignment.dart similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/flutter/customAssignment.dart rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/flutter/customAssignment.dart diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/flutter/customAssignments.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/flutter/customAssignments.dart similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/flutter/customAssignments.dart rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/flutter/customAssignments.dart diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/go/customAssignment.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/go/customAssignment.go similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/go/customAssignment.go rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/go/customAssignment.go diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/go/customAssignments.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/go/customAssignments.go similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/go/customAssignments.go rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/go/customAssignments.go diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/java/customAssignment.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/java/customAssignment.java similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/java/customAssignment.java rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/java/customAssignment.java diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/java/customAssignments.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/java/customAssignments.java similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/java/customAssignments.java rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/java/customAssignments.java diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/js/customAssignment.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/js/customAssignment.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/js/customAssignment.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/js/customAssignment.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/js/customAssignments.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/js/customAssignments.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/js/customAssignments.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/js/customAssignments.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/php/customAssignment.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/php/customAssignment.php similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/php/customAssignment.php rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/php/customAssignment.php diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/php/customAssignments.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/php/customAssignments.php similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/php/customAssignments.php rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/php/customAssignments.php diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/python/customAssignment.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/python/customAssignment.py similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/python/customAssignment.py rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/python/customAssignment.py diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/python/customAssignments.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/python/customAssignments.py similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/python/customAssignments.py rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/python/customAssignments.py diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/react/customAssignment.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/react/customAssignment.js similarity index 69% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/react/customAssignment.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/react/customAssignment.js index 5c3b1c15..f33ff7b9 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/react/customAssignment.js +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/react/customAssignment.js @@ -1,3 +1,5 @@ +const { context } = useABSmartly(); + const chosenVariant = 1; context.customAssignment("experiment_name", chosenVariant); diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/react/customAssignments.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/react/customAssignments.js similarity index 80% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/react/customAssignments.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/react/customAssignments.js index 34844d5c..f6056bd0 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/react/customAssignments.js +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/react/customAssignments.js @@ -1,3 +1,5 @@ +const { context } = useABSmartly(); + const assignments = { experiment_name: 1, another_experiment_name: 0, diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/ruby/customAssignment.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/ruby/customAssignment.rb similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/ruby/customAssignment.rb rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/ruby/customAssignment.rb diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/ruby/customAssignments.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/ruby/customAssignments.rb similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/ruby/customAssignments.rb rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/ruby/customAssignments.rb diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/swift/customAssignment.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/swift/customAssignment.swift similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/swift/customAssignment.swift rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/swift/customAssignment.swift diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/swift/customAssignments.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/swift/customAssignments.swift similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/swift/customAssignments.swift rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/swift/customAssignments.swift diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/vue/customAssignment.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/vue/customAssignment.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/vue/customAssignment.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/vue/customAssignment.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/vue/customAssignments.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/vue/customAssignments.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments/vue/customAssignments.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-assignments/vue/customAssignments.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/_custom-event-logger.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/_custom-event-logger.mdx new file mode 100644 index 00000000..d70aadf1 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/_custom-event-logger.mdx @@ -0,0 +1,133 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; +import CodeBlock from "@theme/CodeBlock"; + +import JsCustomEventLogger from "!!raw-loader!./js/customEventLogger.js"; +import PythonCustomEventLogger from "!!raw-loader!./python/customEventLogger.py"; +import ReactCustomEventLogger from "!!raw-loader!./react/customEventLogger.jsx"; +import SwiftCustomEventLogger from "!!raw-loader!./swift/customEventLogger.swift"; +import VueCustomEventLogger from "!!raw-loader!./vue/customEventLogger.js"; +import JavaCustomEventLogger from "!!raw-loader!./java/customEventLogger.java"; +import GoCustomEventLogger from "!!raw-loader!./go/customEventLogger.go"; + +import DotNetCustomEventLogger from "!!raw-loader!./dotnet/customEventLogger.cs"; +import DotNetCustomEventLoggerWithInjection from "!!raw-loader!./dotnet/customEventLoggerInjection.cs"; + +import PHPCustomEventLogger from "!!raw-loader!./php/customEventLogger.php"; +import PHPHandleEvent from "!!raw-loader!./php/handleEvent.php"; + +import RubyCustomEventLogger from "!!raw-loader!./ruby/customEventLogger.rb"; + +import FlutterCustomEventLogger from "!!raw-loader!./flutter/customEventLogger.dart"; +import FlutterUsage from "!!raw-loader!./flutter/usage.dart"; + +The SDK can be instantiated with an event logger used for all contexts. In +addition, most SDKs let you specify an event logger per context when calling +`createContext`. + +The event logger receives events with a data payload that depends on the event +type. The SDK fires the following events: + +| Event | When | Data | +| --- | --- | --- | +| error | `Context` receives an error | Error/exception object | +| ready | `Context` turns ready | `ContextData` used to initialize the context | +| refresh | `refresh()` succeeds | `ContextData` used to refresh the context | +| publish | `publish()` succeeds | Event data sent to the ABsmartly collector | +| exposure | `treatment()` succeeds on first exposure | Exposure data enqueued for publishing | +| goal | `track()` succeeds | Goal data enqueued for publishing | +| close / finalize | Context is closed or finalized | `null` / `undefined` | + +:::note Naming differences +JavaScript, React, Vue, and Flutter use `"finalize"` for the close event. +Python, Java, Go, Swift, .NET, PHP, and Ruby use `"close"`. The method and +event names in the code examples below match each SDK's convention. +::: + + + + + +{JsCustomEventLogger} + + + + + +{PythonCustomEventLogger} + + + + + +{ReactCustomEventLogger} + + + + + +{SwiftCustomEventLogger} + + + + + +{VueCustomEventLogger} + + + + + +{VueCustomEventLogger} + + + + + +{JavaCustomEventLogger} + + + + + +{GoCustomEventLogger} + + + + + +{DotNetCustomEventLogger} + +With dependency injection: + +{DotNetCustomEventLoggerWithInjection} + + + + + +{PHPCustomEventLogger} + +Alternatively, you can implement the `\ABSmartly\SDK\Context\ContextEventLogger` +interface with a `handleEvent()` method that receives the `Context` object and a +`ContextEventLoggerEvent`: + +{PHPHandleEvent} + + + + + +{RubyCustomEventLogger} + + + + + +{FlutterCustomEventLogger} + +{FlutterUsage} + + + + diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/dotnet/customEventLogger.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/dotnet/customEventLogger.cs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/dotnet/customEventLogger.cs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/dotnet/customEventLogger.cs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/dotnet/customEventLoggerInjection.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/dotnet/customEventLoggerInjection.cs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/dotnet/customEventLoggerInjection.cs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/dotnet/customEventLoggerInjection.cs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/flutter/customEventLogger.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/flutter/customEventLogger.dart similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/flutter/customEventLogger.dart rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/flutter/customEventLogger.dart diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/flutter/usage.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/flutter/usage.dart similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/flutter/usage.dart rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/flutter/usage.dart diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/go/customEventLogger.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/go/customEventLogger.go similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/go/customEventLogger.go rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/go/customEventLogger.go diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/java/customEventLogger.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/java/customEventLogger.java similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/java/customEventLogger.java rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/java/customEventLogger.java diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/js/customEventLogger.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/js/customEventLogger.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/js/customEventLogger.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/js/customEventLogger.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/php/customEventLogger.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/php/customEventLogger.php similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/php/customEventLogger.php rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/php/customEventLogger.php diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/php/handleEvent.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/php/handleEvent.php similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/php/handleEvent.php rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/php/handleEvent.php diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/python/customEventLogger.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/python/customEventLogger.py similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/python/customEventLogger.py rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/python/customEventLogger.py diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/react/customEventLogger.jsx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/react/customEventLogger.jsx similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/react/customEventLogger.jsx rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/react/customEventLogger.jsx diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/ruby/customEventLogger.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/ruby/customEventLogger.rb new file mode 100644 index 00000000..bfad10f0 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/ruby/customEventLogger.rb @@ -0,0 +1,33 @@ +class CustomEventLogger < ContextEventLogger + def handle_event(event, data) + case event + when EVENT_TYPE::EXPOSURE + puts "Exposure: #{data}" + when EVENT_TYPE::GOAL + puts "Goal: #{data}" + when EVENT_TYPE::ERROR + puts "Error: #{data}" + when EVENT_TYPE::PUBLISH + puts "Publish: #{data}" + when EVENT_TYPE::READY + puts "Ready: #{data}" + when EVENT_TYPE::REFRESH + puts "Refresh: #{data}" + when EVENT_TYPE::CLOSE + puts "Close" + end + end +end + +# For all contexts, during SDK initialization +Absmartly.configure_client do |config| + config.endpoint = "https://your-company.absmartly.io/v1" + config.api_key = "YOUR-API-KEY" + config.application = "website" + config.environment = "production" + config.event_logger = CustomEventLogger.new +end + +# OR, for a particular context +context_config = Absmartly.create_context_config +context_config.set_event_logger(CustomEventLogger.new) diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/swift/customEventLogger.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/swift/customEventLogger.swift similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/swift/customEventLogger.swift rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/swift/customEventLogger.swift diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/vue/customEventLogger.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/vue/customEventLogger.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/vue/customEventLogger.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/custom-event-logger/vue/customEventLogger.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/_finalize.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/_finalize.mdx similarity index 92% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/_finalize.mdx rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/_finalize.mdx index 5f091ebf..5282de41 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/_finalize.mdx +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/_finalize.mdx @@ -24,16 +24,8 @@ import RubyFinalize from "!!raw-loader!./ruby/finalize.rb"; import FlutterFinalize from "!!raw-loader!./flutter/finalize.dart"; -Finalizing (or closing) a context publishes any unpublished events before -"sealing" it. Any `track` calls after a context has been finalized will throw -an error. - -Some examples of when you may want to finalize a context: - -- When your application is being destroyed. -- When a user logs out. In this case, you no longer know if the current user -is the same user as before. It is best to finalize the original context, -create a new one and pass it an `anonymous_id`. +Finalizing (or closing) a context flushes any unpublished events and then +seals it. Any `track()` calls after finalization will throw an error. diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/dotnet/finalize.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/dotnet/finalize.cs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/dotnet/finalize.cs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/dotnet/finalize.cs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/flutter/finalize.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/flutter/finalize.dart similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/flutter/finalize.dart rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/flutter/finalize.dart diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/go/finalize.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/go/finalize.go similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/go/finalize.go rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/go/finalize.go diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/java/finalize.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/java/finalize.java similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/java/finalize.java rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/java/finalize.java diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/js/finalize.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/js/finalize.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/js/finalize.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/js/finalize.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/php/finalize.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/php/finalize.php similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/php/finalize.php rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/php/finalize.php diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/python/finalize.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/python/finalize.py similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/python/finalize.py rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/python/finalize.py diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/react/finalize.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/react/finalize.js similarity index 68% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/react/finalize.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/react/finalize.js index 313a9399..f1d595d7 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/react/finalize.js +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/react/finalize.js @@ -1,3 +1,5 @@ +const { context } = useABSmartly(); + context.finalize().then(() => { document.location.replace("another_page"); }); diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/ruby/finalize.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/ruby/finalize.rb similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/ruby/finalize.rb rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/ruby/finalize.rb diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/swift/finalize.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/swift/finalize.swift similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/swift/finalize.swift rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/swift/finalize.swift diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/vue/finalize.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/vue/finalize.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/finalize/vue/finalize.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/finalize/vue/finalize.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/_install.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/_install.mdx similarity index 78% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/_install.mdx rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/_install.mdx index ca9cf58c..007279a5 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/_install.mdx +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/_install.mdx @@ -42,10 +42,11 @@ it. -**NPM** - {JsBashInstall} +
+Other installation methods + **Direct Import** {JsDirectImport} @@ -56,36 +57,42 @@ implementation. If your environment does not support ES6 promises, you can polyfill. ::: +
+
-:::info Compatibility -The ABsmartly Python SDK is compatible with Python 3. It provides both a blocking and an asynchronous interfaces. -::: +{PythonBashInstall} -**Pip** +
+Compatibility and dependencies -{PythonBashInstall} +The ABsmartly Python SDK is compatible with Python 3. It provides both a blocking and an asynchronous interface. -**Dependencies** +**Dependencies:** - `setuptools~=60.2.0` - `requests~=2.28.1` - `urllib3~=1.26.12` - `jsons~=1.6.3` +
+
{ReactBashInstall} -:::note Please Note +
+Server-side rendering + The ABSmartly React SDK selects and renders treatments on the client-side. If you wish to use server-side rendering with NextJS or similar, you will need to use the Javascript SDK or a combination of the two. -::: + +
@@ -98,10 +105,10 @@ similar, you will need to use the Javascript SDK or a combination of the two. 3. Select the SDK version (latest recommended) 4. Select the ABSmartly library -**Cocoapods** +
+Using CocoaPods instead -To install the ABsmartly SDK with CocoaPods, add the following lines to -your `Podfile`: +Add the following lines to your `Podfile`: {SwiftPodfile} @@ -109,44 +116,63 @@ Run the following command to update your Xcode project: {SwiftUpdateXcode} +
+ -**Using NPM** - {VueInstall} -**Directly Import With unpkg.com -(Optimized and Pre-Built)** +
+Direct import via CDN -Simply add the following code to your `head` section to include the latest -published version. +Add the following to your `head` section to include the latest published version +from unpkg.com: {VueDirectImport} +
+
-**Using NPM** - {Vue3Install} -**Directly Import With unpkg.com -(Optimized and Pre-Built)** +
+Direct import via CDN -Simply add the following code to your `head` section to include the latest -published version. +Add the following to your `head` section to include the latest published version +from unpkg.com: {Vue3DirectImport} +
+
-:::info Compatibility +**Gradle** + +Replace \{VERSION\} with the latest SDK version available in MavenCentral. + +{JavaGradleInstall} + +
+Using Maven instead + +Replace \{VERSION\} with the latest SDK version available in MavenCentral. + +{JavaMavenInstall} + +
+ +
+Compatibility and Android support + The ABsmartly Java SDK is compatible with Java versions 1.6 and later. It provides both a blocking and an asynchronous interface. The asynchronous functions return a custom backport @@ -164,24 +190,6 @@ to your application ensure the following line is present in the ``` -If you target Android 6.0 or earlier, a few extra steps are outlined below for -installation and initialization. -::: - -**Gradle** - -To install the ABSmartly SDK, place the following in your `build.gradle` and -replace \{VERSION\} with the latest SDK version available in MavenCentral. - -{JavaGradleInstall} - -**Maven** - -To install the ABSmartly SDK, place the following in your `pom.xml` and -replace \{VERSION\} with the latest SDK version available in MavenCentral. - -{JavaMavenInstall} - :::caution Android 6.0 or earlier When targeting Android 6.0 or earlier, the default Java Security Provider will not work. @@ -191,81 +199,88 @@ Follow + -:::info Compatibility -The ABsmartly Go SDK is compatible with Go versions 1.15 and later. It -provides both a blocking and an asynchronous interfaces. -::: +{GoModulesInstall} -**Go Modules** +{GoDependenciesInstall} -{GoModulesInstall} +
+Compatibility -**Dependencies** +The ABsmartly Go SDK is compatible with Go versions 1.15 and later. It +provides both a blocking and an asynchronous interface. -{GoDependenciesInstall} +
-:::info Compatibility -The .NET SDK targets **.NET Standard 2.0** and **.NET 5**, but is also fully compatible with **.NET 6**. -::: +{DotNetInstall} -**Nuget** +
+Compatibility -{DotNetInstall} +The .NET SDK targets **.NET Standard 2.0** and **.NET 5**, but is also fully compatible with **.NET 6**. + +
-:::info Compatibility +{PHPInstall} + +
+Compatibility + The ABsmartly PHP SDK is compatible with PHP versions 7.4 and later. For the best performance and code readability, PHP 8.1 or later is recommended. This SDK is being constantly tested with the nightly builds of PHP, to ensure it is compatible with the latest PHP version. -::: -ABsmartly PHP SDK can be installed with [composer](https://getcomposer.org/): - -{PHPInstall} +
-:::info Compatibility +{RubyBundlerInstall} + +
+Installing without Bundler + +{RubyGemInstall} + +
+ +
+Compatibility + The ABsmartly Ruby SDK is compatible with **Ruby versions 2.7 and later**. For the best performance and code readability, **Ruby 3 or later** is recommended. This SDK is being constantly tested with the nightly builds of Ruby, to ensure it is compatible with the latest Ruby version. -::: -**With Bundler** - -{RubyBundlerInstall} - -**Without Bundler** - -{RubyGemInstall} +
-:::info Compatibility -The ABsmartly Flutter SDK is compatible with Dart versions -2.18.6 and later. -::: +{FlutterInstall} -To install the ABSmartly SDK, place the following in your `pubspec.yaml` and replace version with the latest SDK version available in pub.dev. +
+Compatibility -{FlutterInstall} +The ABsmartly Flutter SDK is compatible with Dart versions 2.18.6 and later. + +
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/dotnet/install.bash b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/dotnet/install.bash similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/dotnet/install.bash rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/dotnet/install.bash diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/flutter/install.yaml b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/flutter/install.yaml similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/flutter/install.yaml rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/flutter/install.yaml diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/go/dependencies.bash b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/go/dependencies.bash similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/go/dependencies.bash rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/go/dependencies.bash diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/go/go.mod b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/go/go.mod similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/go/go.mod rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/go/go.mod diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/checksums/checksums.lock b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/checksums/checksums.lock similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/checksums/checksums.lock rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/checksums/checksums.lock diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/dependencies-accessors/gc.properties b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/dependencies-accessors/gc.properties similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/dependencies-accessors/gc.properties rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/dependencies-accessors/gc.properties diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/fileChanges/last-build.bin b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/fileChanges/last-build.bin similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/fileChanges/last-build.bin rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/fileChanges/last-build.bin diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/fileHashes/fileHashes.lock b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/fileHashes/fileHashes.lock similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/fileHashes/fileHashes.lock rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/fileHashes/fileHashes.lock diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/gc.properties b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/gc.properties similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/7.4.2/gc.properties rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/7.4.2/gc.properties diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/buildOutputCleanup/buildOutputCleanup.lock similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/buildOutputCleanup/buildOutputCleanup.lock rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/buildOutputCleanup/buildOutputCleanup.lock diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/buildOutputCleanup/cache.properties b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/buildOutputCleanup/cache.properties similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/buildOutputCleanup/cache.properties rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/buildOutputCleanup/cache.properties diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/vcs-1/gc.properties b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/vcs-1/gc.properties similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.gradle/vcs-1/gc.properties rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.gradle/vcs-1/gc.properties diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.project b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.project similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.project rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.project diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.settings/org.eclipse.buildship.core.prefs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.settings/org.eclipse.buildship.core.prefs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/.settings/org.eclipse.buildship.core.prefs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/.settings/org.eclipse.buildship.core.prefs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/build.gradle b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/build.gradle similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/build.gradle rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/build.gradle diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/pom.xml b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/pom.xml similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/java/pom.xml rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/java/pom.xml diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/js/directImport.html b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/js/directImport.html similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/js/directImport.html rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/js/directImport.html diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/js/install.bash b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/js/install.bash similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/js/install.bash rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/js/install.bash diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/php/install.bash b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/php/install.bash similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/php/install.bash rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/php/install.bash diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/python/install.bash b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/python/install.bash similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/python/install.bash rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/python/install.bash diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/react/install.bash b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/react/install.bash similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/react/install.bash rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/react/install.bash diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/ruby/bundler.sh b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/ruby/bundler.sh similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/ruby/bundler.sh rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/ruby/bundler.sh diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/ruby/gem.sh b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/ruby/gem.sh similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/ruby/gem.sh rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/ruby/gem.sh diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/swift/Podfile b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/swift/Podfile similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/swift/Podfile rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/swift/Podfile diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/swift/updateXcode.bash b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/swift/updateXcode.bash similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/swift/updateXcode.bash rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/swift/updateXcode.bash diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/vue/directImport.html b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/vue/directImport.html similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/vue/directImport.html rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/vue/directImport.html diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/vue/install.bash b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/vue/install.bash similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/vue/install.bash rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/vue/install.bash diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/vue3/directImport.html b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/vue3/directImport.html similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/vue3/directImport.html rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/vue3/directImport.html diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/vue3/install.bash b/docs/APIs-and-SDKs/SDK-Documentation/_shared/install/vue3/install.bash similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/getting-started/install/vue3/install.bash rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/install/vue3/install.bash diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/_overriding.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/_overriding.mdx similarity index 52% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/_overriding.mdx rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/_overriding.mdx index e561e3e3..525904e1 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/_overriding.mdx +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/_overriding.mdx @@ -25,64 +25,44 @@ import RubyOverriding from "!!raw-loader!./ruby/override.rb"; import FlutterOverriding from "!!raw-loader!./flutter/override.dart"; -:::warning Warning -Overriden events are typed as ineligible and are **ignored** by the ABsmartly statistics engines. -If you want to force a particular experiment's variant and have the event be counted, you -can use the [`customAssignment` methods](/docs/APIs-and-SDKs/SDK-Documentation/Advanced/custom-assignments) -instead, although this **is not recommended**. +:::warning +Overridden events are marked as **ineligible** and completely ignored by +ABsmartly's statistics engine. If you need the event to count as real data, use +[custom assignments](/docs/APIs-and-SDKs/SDK-Documentation/targeting-and-audiences#custom-assignments) +instead, though this is rarely what you want for QA. ::: +Override methods force a specific variant. They can be called before the +context is ready. + -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved with the `override()` and/or `overrides()` -methods. The `override()` and `overrides()` methods can be called before the context is -ready. - {JsOverriding} -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved with the `set_override()` and/or `set_overrides()` methods. The `set_override()` and `set_overrides()` methods can be called before the context is -ready. - {PythonOverriding} -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved with the `override()` and/or `overrides()` -methods. The `override()` and `overrides()` methods can be called before the context is -ready. - {ReactOverriding} -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved with the `override()` and/or `overrides()` -methods. The `setOverride()` and `setOverrides()` methods can be called before -the context is ready. - {SwiftOverriding} -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved in the initialization of the SDK or with the -`override()` and/or `overrides()` methods. - ##### In the SDK initialization {VueOverridingInInitialization} @@ -91,18 +71,10 @@ experiment. This can be achieved in the initialization of the SDK or with the {VueWithOverrideMethods} -:::info -The `override()` and `overrides()` methods can be called before the context is ready. -::: - -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved in the initialization of the SDK or with the -`override()` and/or `overrides()` methods. - ##### In the SDK initialization {VueOverridingInInitialization} @@ -111,74 +83,40 @@ experiment. This can be achieved in the initialization of the SDK or with the {VueWithOverrideMethods} -:::info -The `override()` and `overrides()` methods can be called before the context is ready. -::: - -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved with the `override()` and/or `overrides()` -methods. The `setOverride()` and `setOverrides()` methods can be called before -the context is ready. - {JavaOverriding} -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved with the `Override()` and/or `Overrides()` -methods. The `SetOverride()` and `SetOverrides()` methods can be called before -the context is ready. - {GoOverriding} -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved with the `SetOverride()` and/or -`SetOverrides()` methods. The `SetOverride()` and `SetOverrides()` methods can -be called before the context is ready. - {DotNetOverriding} -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved with the `Context->setOverride()` and/or -`Context->setOverrides()` methods. These methods can be called before the -context is ready. - {PHPOverriding} -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved with the `set_override()` and/or -`set_overrides()` methods. These methods can be called before the context is -ready. - {RubyOverriding} -During development, for example, it is useful to force a treatment for an -experiment. This can be achieved with the `override()` and/or `overrides()` -methods. The `setOverride()` and `setOverrides()` methods can be called before -the context is ready. - {FlutterOverriding} @@ -208,7 +146,7 @@ function getABsmartlyOverridesFromQuery(req) { // Check if the query parameter starts with "absmartly_" if (key.startsWith('absmartly_')) { // Extract the experiment name (remove "absmartly_" prefix) - const experimentName = key.slice(9); + const experimentName = key.slice('absmartly_'.length); // Convert the value to a number if possible, otherwise keep it as a string const variantValue = isNaN(value) ? value : Number(value); diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/dotnet/override.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/dotnet/override.cs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/dotnet/override.cs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/dotnet/override.cs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/flutter/override.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/flutter/override.dart similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/flutter/override.dart rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/flutter/override.dart diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/go/override.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/go/override.go similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/go/override.go rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/go/override.go diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/java/override.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/java/override.java similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/java/override.java rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/java/override.java diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/js/override.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/js/override.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/js/override.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/js/override.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/php/override.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/php/override.php similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/php/override.php rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/php/override.php diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/python/override.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/python/override.py similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/python/override.py rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/python/override.py diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/react/override.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/react/override.js similarity index 80% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/react/override.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/react/override.js index bf4fc16a..c68071b4 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/react/override.js +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/react/override.js @@ -1,3 +1,5 @@ +const { context } = useABSmartly(); + context.override("exp_test_experiment", 1); // force variant 1 of treatment context.overrides({ exp_test_experiment: 1, diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/ruby/override.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/ruby/override.rb similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/ruby/override.rb rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/ruby/override.rb diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/swift/override.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/swift/override.swift similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/swift/override.swift rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/swift/override.swift diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/vue/inInitialization.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/vue/inInitialization.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/vue/inInitialization.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/vue/inInitialization.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/vue/withOverrideMethods.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/vue/withOverrideMethods.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/overriding/vue/withOverrideMethods.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/overriding/vue/withOverrideMethods.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/_peeking.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/_peeking.mdx similarity index 66% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/_peeking.mdx rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/_peeking.mdx index d429c5c4..48337fb4 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/_peeking.mdx +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/_peeking.mdx @@ -25,13 +25,16 @@ import RubyPeekAtVariable from "!!raw-loader!./ruby/peekAtVariables.rb"; import FlutterPeekAtVariant from "!!raw-loader!./flutter/peekAtVariants.dart"; import FlutterPeekAtVariable from "!!raw-loader!./flutter/peekAtVariables.dart"; +## Peeking at treatments + +The peek method returns the variant number just like `treatment()`, but without +recording an exposure. It's called `peek()` in JavaScript, React, and Vue, and +`peekTreatment()` in other SDKs. + -Although generally not recommended, it is sometimes necessary to peek at a -treatment without triggering an exposure. The ABsmartly SDK provides a -`peek()` method for that. {JsPeekAtVariant} @@ -39,9 +42,6 @@ treatment without triggering an exposure. The ABsmartly SDK provides a -Although generally not recommended, it is sometimes necessary to peek at a -treatment without triggering an exposure. The ABsmartly SDK provides a -`peek_treatment()` method for that. {PythonPeekAtVariant} @@ -49,9 +49,6 @@ treatment without triggering an exposure. The ABsmartly SDK provides a -Although generally not recommended, it is sometimes necessary to peek at a -treatment without triggering an exposure. The ABsmartly SDK provides a -`peek()` method for that. {ReactPeekAtVariant} @@ -59,9 +56,6 @@ treatment without triggering an exposure. The ABsmartly SDK provides a -Although generally not recommended, it is sometimes necessary to peek at a -treatment without triggering an exposure. The ABsmartly SDK provides a -`peekTreatment()` method for that. {SwiftPeekAtVariants} @@ -69,9 +63,6 @@ treatment without triggering an exposure. The ABsmartly SDK provides a -Although generally not recommended, it is sometimes necessary to peek at a -treatment without triggering an exposure. The ABsmartly SDK provides a -`peek()` method for that. {VuePeekAtVariant} @@ -79,9 +70,6 @@ treatment without triggering an exposure. The ABsmartly SDK provides a -Although generally not recommended, it is sometimes necessary to peek at a -treatment without triggering an exposure. The ABsmartly SDK provides a -`peek()` method for that. {VuePeekAtVariant} @@ -89,9 +77,6 @@ treatment without triggering an exposure. The ABsmartly SDK provides a -Although generally not recommended, it is sometimes necessary to peek at a -treatment or variable without triggering an exposure. The ABsmartly SDK -provides a `peekTreatment()` method for that. {JavaPeekAtVariants} @@ -99,9 +84,6 @@ provides a `peekTreatment()` method for that. -Although generally not recommended, it is sometimes necessary to peek at a -treatment or variable without triggering an exposure. The ABsmartly SDK -provides a `PeekTreatment()` method for that. {GoPeekAtVariants} @@ -109,9 +91,6 @@ provides a `PeekTreatment()` method for that. -Although generally not recommended, it is sometimes necessary to peek at -a treatment or variable without triggering an exposure. The ABsmartly -SDK provides a `PeekTreatment()` method for that. {DotNetPeekAtVariants} @@ -119,9 +98,6 @@ SDK provides a `PeekTreatment()` method for that. -Although generally not recommended, it is sometimes necessary to peek at a -treatment or variable without triggering an exposure. The ABsmartly SDK -provides a `Context->peekTreatment()` method for that. {PHPPeekAtVariant} @@ -129,9 +105,6 @@ provides a `Context->peekTreatment()` method for that. -Although generally not recommended, it is sometimes necessary to peek at a -treatment or variable without triggering an exposure. The ABsmartly SDK -provides a `peek_treatment()` method for that. {RubyPeekAtVariant} @@ -139,9 +112,6 @@ provides a `peek_treatment()` method for that. -Although generally not recommended, it is sometimes necessary to peek at a -treatment or variable without triggering an exposure. The ABsmartly SDK -provides a `peekTreatment()` method for that. {FlutterPeekAtVariant} @@ -151,6 +121,10 @@ provides a `peekTreatment()` method for that. ## Peeking at variables +The peek variable method returns the variable value just like `variableValue()`, +but without recording an exposure. It's called `peekVariableValue()` in most SDKs +and `peek_variable_value()` in Python and Ruby. + diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/dotnet/peekAtVariables.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/dotnet/peekAtVariables.cs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/dotnet/peekAtVariables.cs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/dotnet/peekAtVariables.cs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/dotnet/peekAtVariants.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/dotnet/peekAtVariants.cs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/dotnet/peekAtVariants.cs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/dotnet/peekAtVariants.cs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/flutter/peekAtVariables.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/flutter/peekAtVariables.dart similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/flutter/peekAtVariables.dart rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/flutter/peekAtVariables.dart diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/flutter/peekAtVariants.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/flutter/peekAtVariants.dart similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/flutter/peekAtVariants.dart rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/flutter/peekAtVariants.dart diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/go/peekAtVariables.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/go/peekAtVariables.go similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/go/peekAtVariables.go rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/go/peekAtVariables.go diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/go/peekAtVariants.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/go/peekAtVariants.go similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/go/peekAtVariants.go rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/go/peekAtVariants.go diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/java/peekAtVariables.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/java/peekAtVariables.java similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/java/peekAtVariables.java rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/java/peekAtVariables.java diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/java/peekAtVariants.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/java/peekAtVariants.java similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/java/peekAtVariants.java rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/java/peekAtVariants.java diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/js/peekAtVariables.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/js/peekAtVariables.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/js/peekAtVariables.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/js/peekAtVariables.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/js/peekAtVariant.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/js/peekAtVariant.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/js/peekAtVariant.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/js/peekAtVariant.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/php/peekAtVariable.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/php/peekAtVariable.php similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/php/peekAtVariable.php rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/php/peekAtVariable.php diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/php/peekAtVariant.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/php/peekAtVariant.php similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/php/peekAtVariant.php rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/php/peekAtVariant.php diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/python/peekAtVariables.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/python/peekAtVariables.py similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/python/peekAtVariables.py rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/python/peekAtVariables.py diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/python/peekAtVariant.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/python/peekAtVariant.py similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/python/peekAtVariant.py rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/python/peekAtVariant.py diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/react/peekAtVariables.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/react/peekAtVariables.js similarity index 65% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/react/peekAtVariables.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/react/peekAtVariables.js index c7be57ad..a31a890a 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/react/peekAtVariables.js +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/react/peekAtVariables.js @@ -1 +1,3 @@ +const { context } = useABSmartly(); + const buttonColor = context.peekVariableValue("button.color", "red"); diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/react/peekAtVariant.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/react/peekAtVariant.js similarity index 88% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/react/peekAtVariant.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/react/peekAtVariant.js index 1345c756..b27a0fde 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/react/peekAtVariant.js +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/react/peekAtVariant.js @@ -1,3 +1,5 @@ +const { context } = useABSmartly(); + useEffect(() => { context .ready() diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/ruby/peekAtVariables.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/ruby/peekAtVariables.rb similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/ruby/peekAtVariables.rb rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/ruby/peekAtVariables.rb diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/ruby/peekAtVariants.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/ruby/peekAtVariants.rb similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/ruby/peekAtVariants.rb rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/ruby/peekAtVariants.rb diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/swift/peekAtVariables.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/swift/peekAtVariables.swift similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/swift/peekAtVariables.swift rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/swift/peekAtVariables.swift diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/swift/peekAtVariants.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/swift/peekAtVariants.swift similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/swift/peekAtVariants.swift rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/swift/peekAtVariants.swift diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/vue/peekAtVariables.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/vue/peekAtVariables.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/vue/peekAtVariables.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/vue/peekAtVariables.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/vue/peekAtVariant.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/vue/peekAtVariant.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/peeking/vue/peekAtVariant.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/peeking/vue/peekAtVariant.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/_publish.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/_publish.mdx new file mode 100644 index 00000000..ecf3c699 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/_publish.mdx @@ -0,0 +1,113 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; +import CodeBlock from "@theme/CodeBlock"; + +import JsPublish from "!!raw-loader!./js/publish.js"; + +import PythonPublish from "!!raw-loader!./python/publish.py"; + +import ReactPublish from "!!raw-loader!./react/publish.js"; + +import SwiftPublish from "!!raw-loader!./swift/publish.swift"; + +import VuePublish from "!!raw-loader!./vue/publish.js"; + +import JavaPublish from "!!raw-loader!./java/publish.java"; + +import GoPublish from "!!raw-loader!./go/publish.go"; + +import DotNetPublish from "!!raw-loader!./dotnet/publish.cs"; + +import PHPPublish from "!!raw-loader!./php/publish.php"; + +import RubyPublish from "!!raw-loader!./ruby/publish.rb"; + +import FlutterPublish from "!!raw-loader!./flutter/publish.dart"; + +Call `publish()` before page navigations, server responses, or any point where +the process might exit before the SDK's auto-flush fires. This ensures exposure +and goal data is sent to the collector before the context is lost. + + + + + +{JsPublish} + + + + + +Python also provides `publish_async()` for non-blocking use. + +{PythonPublish} + + + + + +{ReactPublish} + + + + + +{SwiftPublish} + + + + + +{VuePublish} + + + + + +{VuePublish} + + + + + +Java also provides `publishAsync()` for non-blocking use. + +{JavaPublish} + + + + + +Go also provides `PublishAsync()` for non-blocking use. + +{GoPublish} + + + + + +.NET also provides `PublishAsync()` for non-blocking use. + +{DotNetPublish} + + + + + +{PHPPublish} + + + + + +{RubyPublish} + + + + + +{FlutterPublish} + + + + diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/dotnet/publish.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/dotnet/publish.cs similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/dotnet/publish.cs rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/dotnet/publish.cs diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/flutter/publish.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/flutter/publish.dart similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/flutter/publish.dart rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/flutter/publish.dart diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/go/publish.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/go/publish.go similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/go/publish.go rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/go/publish.go diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/java/publish.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/java/publish.java similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/java/publish.java rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/java/publish.java diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/js/publish.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/js/publish.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/js/publish.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/js/publish.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/php/publish.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/php/publish.php similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/php/publish.php rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/php/publish.php diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/python/publish.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/python/publish.py similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/python/publish.py rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/python/publish.py diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/react/publish.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/react/publish.js similarity index 68% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/react/publish.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/react/publish.js index 984809cd..9268d3bf 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/react/publish.js +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/react/publish.js @@ -1,3 +1,5 @@ +const { context } = useABSmartly(); + context.publish().then(() => { document.location.replace("another_page"); }); diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/ruby/publish.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/ruby/publish.rb similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/ruby/publish.rb rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/ruby/publish.rb diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/swift/publish.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/swift/publish.swift similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/swift/publish.swift rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/swift/publish.swift diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/vue/publish.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/vue/publish.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/publish/vue/publish.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/publish/vue/publish.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/dotnet/selectingATreatment.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/dotnet/selectingATreatment.cs new file mode 100644 index 00000000..187ce573 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/dotnet/selectingATreatment.cs @@ -0,0 +1,7 @@ +var treatment = context.GetTreatment("homepage_banner_experiment"); + +if (treatment == 0) { + ShowBanner("Welcome back!"); +} else if (treatment == 1) { + ShowBanner("Check out our latest deals!"); +} diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/flutter/selectingATreatment.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/flutter/selectingATreatment.dart new file mode 100644 index 00000000..7f658d01 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/flutter/selectingATreatment.dart @@ -0,0 +1,7 @@ +final treatment = await context.getTreatment("homepage_banner_experiment"); + +if (treatment == 0) { + showBanner("Welcome back!"); +} else if (treatment == 1) { + showBanner("Check out our latest deals!"); +} diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/go/selectingATreatment.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/go/selectingATreatment.go new file mode 100644 index 00000000..6971926d --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/go/selectingATreatment.go @@ -0,0 +1,7 @@ +treatment, _ := context.GetTreatment("homepage_banner_experiment") + +if treatment == 0 { + showBanner("Welcome back!") +} else if treatment == 1 { + showBanner("Check out our latest deals!") +} diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/java/selectingATreatment.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/java/selectingATreatment.java new file mode 100644 index 00000000..6141fbd8 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/java/selectingATreatment.java @@ -0,0 +1,7 @@ +int treatment = context.getTreatment("homepage_banner_experiment"); + +if (treatment == 0) { + showBanner("Welcome back!"); +} else if (treatment == 1) { + showBanner("Check out our latest deals!"); +} diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/js/selectingATreatment.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/js/selectingATreatment.js new file mode 100644 index 00000000..0b1300ad --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/js/selectingATreatment.js @@ -0,0 +1,7 @@ +const treatment = context.treatment("homepage_banner_experiment"); + +if (treatment === 0) { + showBanner("Welcome back!"); +} else if (treatment === 1) { + showBanner("Check out our latest deals!"); +} diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/php/selectingATreatment.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/php/selectingATreatment.php new file mode 100644 index 00000000..a5f7733d --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/php/selectingATreatment.php @@ -0,0 +1,7 @@ +$treatment = $context->getTreatment('homepage_banner_experiment'); + +if ($treatment === 0) { + showBanner('Welcome back!'); +} else if ($treatment === 1) { + showBanner('Check out our latest deals!'); +} diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/python/selectingATreatment.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/python/selectingATreatment.py new file mode 100644 index 00000000..e869e332 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/python/selectingATreatment.py @@ -0,0 +1,6 @@ +treatment = context.get_treatment("homepage_banner_experiment") + +if treatment == 0: + show_banner("Welcome back!") +elif treatment == 1: + show_banner("Check out our latest deals!") diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/react/selectingATreatment.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/react/selectingATreatment.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/react/selectingATreatment.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/react/selectingATreatment.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/react/usingTernaryOperator.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/react/usingTernaryOperator.js similarity index 100% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/react/usingTernaryOperator.js rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/react/usingTernaryOperator.js diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/react/usingUseTreatment.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/react/usingUseTreatment.js new file mode 100644 index 00000000..f0f1f0c3 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/react/usingUseTreatment.js @@ -0,0 +1,7 @@ +const { variant } = useTreatment("homepage_banner_experiment"); + +if (variant === 0) { + return ; +} + +return ; diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/ruby/selectingATreatment.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/ruby/selectingATreatment.rb new file mode 100644 index 00000000..804a9333 --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/ruby/selectingATreatment.rb @@ -0,0 +1,7 @@ +treatment = context.treatment('homepage_banner_experiment') + +if treatment.zero? + show_banner("Welcome back!") +else + show_banner("Check out our latest deals!") +end diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/swift/selectingATreatment.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/swift/selectingATreatment.swift new file mode 100644 index 00000000..8743c8bf --- /dev/null +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/swift/selectingATreatment.swift @@ -0,0 +1,7 @@ +let treatment = context.getTreatment("homepage_banner_experiment") + +if treatment == 0 { + showBanner("Welcome back!") +} else if treatment == 1 { + showBanner("Check out our latest deals!") +} diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/vue/UsingOnlyDefaultSlot.vue b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/vue/UsingOnlyDefaultSlot.vue similarity index 50% rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/vue/UsingOnlyDefaultSlot.vue rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/vue/UsingOnlyDefaultSlot.vue index 6fd22440..fdedd731 100644 --- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/vue/UsingOnlyDefaultSlot.vue +++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/vue/UsingOnlyDefaultSlot.vue @@ -1,9 +1,9 @@ -