diff --git a/docs/APIs-and-SDKs/SDK-API/_category_.json b/docs/APIs-and-SDKs/SDK-API/_category_.json
index 8b54046d..52fce021 100644
--- a/docs/APIs-and-SDKs/SDK-API/_category_.json
+++ b/docs/APIs-and-SDKs/SDK-API/_category_.json
@@ -1,5 +1,5 @@
{
- "position": 3,
+ "position": 2,
"collapsed": true,
"collapsible": true,
"label": "SDK API"
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..785eb99b 100644
--- a/docs/APIs-and-SDKs/SDK-Documentation/_category_.json
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_category_.json
@@ -1,4 +1,5 @@
{
+ "label": "SDK Guide",
"position": 1,
"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..6b1e961b
--- /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', 'YOUR-API-KEY', 'production', 'website',
+);
+```
+:::
+
+
+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..ea5fc20a
--- /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..42309a38
--- /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 77%
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..9ffd5c30 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,47 +116,66 @@ 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
+functions return a custom backport
of the Java 8 `CompletableFuture` API.
**Android**
@@ -164,108 +190,97 @@ 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.
-Using Conscrypt
+Using Conscrypt
is recommended.
-Follow these instructions
+Follow these instructions
to install it as dependency.
:::
+
+
-:::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..55c01896 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,20 @@ 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. The method name varies by SDK:
+
+- **Javascript, React, Vue**: `peek()`
+- **Python, Ruby**: `peek_treatment()`
+- **PHP, Swift, Java, Flutter/Dart**: `peekTreatment()`
+- **Go, .NET**: `PeekTreatment()`
+
-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 +46,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 +53,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 +60,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 +67,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 +74,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 +81,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 +88,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 +95,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 +102,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 +109,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 +116,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 +125,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..97e12078
--- /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 == 1) {
+ ShowBanner("Check out our latest deals!");
+} else {
+ ShowBanner("Welcome back!");
+}
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..e5e71426
--- /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 == 1) {
+ showBanner("Check out our latest deals!");
+} else {
+ showBanner("Welcome back!");
+}
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..d7ad33d2
--- /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 == 1 {
+ showBanner("Check out our latest deals!")
+} else {
+ showBanner("Welcome back!")
+}
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..5ee7b2f6
--- /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 == 1) {
+ showBanner("Check out our latest deals!");
+} else {
+ showBanner("Welcome back!");
+}
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..a9b74be4
--- /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 === 1) {
+ showBanner("Check out our latest deals!");
+} else {
+ showBanner("Welcome back!");
+}
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..a5897ff9
--- /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 === 1) {
+ showBanner('Check out our latest deals!');
+} else {
+ showBanner('Welcome back!');
+}
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..3d3c67a5
--- /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 == 1:
+ show_banner("Check out our latest deals!")
+else:
+ show_banner("Welcome back!")
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..99c1e6d3
--- /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 === 1) {
+ 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..554932e1
--- /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 == 1
+ show_banner("Check out our latest deals!")
+else
+ show_banner("Welcome back!")
+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..eef586ca
--- /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 == 1 {
+ showBanner("Check out our latest deals!")
+} else {
+ showBanner("Welcome back!")
+}
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 @@
-
+
-
-
+
+
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/vue/UsingTreatmentAlias.vue b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/vue/UsingTreatmentAlias.vue
new file mode 100644
index 00000000..350c978b
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/vue/UsingTreatmentAlias.vue
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/vue/UsingTreatmentIndex.vue b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/vue/UsingTreatmentIndex.vue
similarity index 54%
rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/vue/UsingTreatmentIndex.vue
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/vue/UsingTreatmentIndex.vue
index 95f4a07a..a950a58f 100644
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/vue/UsingTreatmentIndex.vue
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-treatment/vue/UsingTreatmentIndex.vue
@@ -2,11 +2,11 @@
-
-
+
+
-
-
+
+
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/dotnet/selectingAVariable.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/dotnet/selectingAVariable.cs
new file mode 100644
index 00000000..db4bc4f1
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/dotnet/selectingAVariable.cs
@@ -0,0 +1,2 @@
+var buttonColor = context.GetVariableValue("button.color", "blue");
+ctaButton.BackgroundColor = Color.FromName(buttonColor);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/flutter/selectingAVariable.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/flutter/selectingAVariable.dart
new file mode 100644
index 00000000..fecba889
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/flutter/selectingAVariable.dart
@@ -0,0 +1,2 @@
+final buttonColor = context.getVariableValue("button.color", "blue");
+ctaButton.style = ButtonStyle(backgroundColor: colorFromName(buttonColor));
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/go/selectingAVariable.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/go/selectingAVariable.go
new file mode 100644
index 00000000..10ec09b9
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/go/selectingAVariable.go
@@ -0,0 +1,5 @@
+buttonColor, _ := context.GetVariableValue("button.color", "blue")
+
+if color, ok := buttonColor.(string); ok {
+ renderButton(color)
+}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/java/selectingAVariable.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/java/selectingAVariable.java
new file mode 100644
index 00000000..29b58ff6
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/java/selectingAVariable.java
@@ -0,0 +1,2 @@
+String buttonColor = (String) context.getVariableValue("button.color", "blue");
+ctaButton.setBackgroundColor(Color.parseColor(buttonColor));
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/js/selectingAVariable.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/js/selectingAVariable.js
new file mode 100644
index 00000000..424fdba9
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/js/selectingAVariable.js
@@ -0,0 +1,2 @@
+const buttonColor = context.variableValue("button.color", "blue");
+document.getElementById("cta-button").style.backgroundColor = buttonColor;
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/php/selectingAVariable.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/php/selectingAVariable.php
new file mode 100644
index 00000000..46b7c3c5
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/php/selectingAVariable.php
@@ -0,0 +1,2 @@
+$buttonColor = $context->getVariableValue('button.color', 'blue');
+echo '';
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/python/selectingAVariable.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/python/selectingAVariable.py
new file mode 100644
index 00000000..18d2a63f
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/python/selectingAVariable.py
@@ -0,0 +1,2 @@
+button_color = context.get_variable_value("button.color", "blue")
+render_button(color=button_color)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/react/directlyInTreatmentComponent.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/react/directlyInTreatmentComponent.js
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/react/directlyInTreatmentComponent.js
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/react/directlyInTreatmentComponent.js
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/react/inUseEffect.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/react/inUseEffect.js
new file mode 100644
index 00000000..28e0c42d
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/react/inUseEffect.js
@@ -0,0 +1,4 @@
+const { context } = useABSmartly();
+const buttonColor = context.variableValue("button.color", "blue");
+
+return ;
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/ruby/selectingAVariable.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/ruby/selectingAVariable.rb
new file mode 100644
index 00000000..42940a9a
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/ruby/selectingAVariable.rb
@@ -0,0 +1,2 @@
+button_color = context.variable_value('button.color', 'blue')
+render_button(color: button_color)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/swift/selectingAVariable.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/swift/selectingAVariable.swift
new file mode 100644
index 00000000..ba8b4234
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/swift/selectingAVariable.swift
@@ -0,0 +1,2 @@
+let buttonColor = context.getVariableValue("button.color", defaultValue: "blue")
+ctaButton.backgroundColor = UIColor(named: buttonColor)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/vue/selectingAVariable.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/vue/selectingAVariable.js
new file mode 100644
index 00000000..53b3eb19
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/selecting-a-variable/vue/selectingAVariable.js
@@ -0,0 +1,2 @@
+const buttonColor = this.$absmartly.variableValue("button.color", "blue");
+this.ctaStyle = { backgroundColor: buttonColor };
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/_tracking-goals.mdx b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/_tracking-goals.mdx
similarity index 69%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/_tracking-goals.mdx
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/_tracking-goals.mdx
index 53a8bfb4..d2957b79 100644
--- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/_tracking-goals.mdx
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/_tracking-goals.mdx
@@ -14,21 +14,13 @@ import PHPTrackingGoals from "!!raw-loader!./php/trackingGoals.php";
import RubyTrackingGoals from "!!raw-loader!./ruby/trackingGoals.rb";
import FlutterTrackingGoals from "!!raw-loader!./flutter/trackingGoals.dart";
-Use the `track()` method to record any actions that your customers perform.
-Each action is known as a goal and corresponds to a `goal_name` as defined in
-the Web Console. Calling `track()` through the SDKs is the easiest way of
-getting experimentation data into ABsmartly and allows you to measure the
-impact of your experiments on your users' actions and metrics. You can also
-track goals through the Segment.io integration or by using enrichments to
-consume them from other event streams and/or databases. In the examples below
-you can see that the `track()` method can take up to two arguments. The proper
-data type and syntax for each are:
-
-- **goal_name**: The traffic type of the key in the `track()` call. The expected
- data type is `String`. You should only pass values that match the names of goals
- that you have defined in the Web Console, everything else will be ignored.
-- **properties** (Optional): An object of key value pairs that can be used to
- create extra metrics or to filter the goal.
+The `track()` method records user actions. It takes two arguments:
+
+- **goal_name**: The name of the goal, matching one you've defined in the Web
+ Console. Any name that doesn't match will be ignored (unless
+ `AUTO_GOAL_CREATION` is enabled on your instance).
+- **properties** (optional): Key-value pairs for extra metrics or filtering
+ (e.g., revenue, item category).
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/dotnet/trackingGoals.cs b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/dotnet/trackingGoals.cs
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/dotnet/trackingGoals.cs
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/dotnet/trackingGoals.cs
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/flutter/trackingGoals.dart b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/flutter/trackingGoals.dart
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/flutter/trackingGoals.dart
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/flutter/trackingGoals.dart
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/go/trackingGoals.go b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/go/trackingGoals.go
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/go/trackingGoals.go
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/go/trackingGoals.go
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/java/trackingGoals.java b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/java/trackingGoals.java
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/java/trackingGoals.java
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/java/trackingGoals.java
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/js/trackingGoals.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/js/trackingGoals.js
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/js/trackingGoals.js
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/js/trackingGoals.js
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/php/trackingGoals.php b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/php/trackingGoals.php
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/php/trackingGoals.php
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/php/trackingGoals.php
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/python/trackingGoals.py b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/python/trackingGoals.py
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/python/trackingGoals.py
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/python/trackingGoals.py
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/react/trackingGoals.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/react/trackingGoals.js
similarity index 80%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/react/trackingGoals.js
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/react/trackingGoals.js
index 825bb4b4..c0d94f15 100644
--- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/react/trackingGoals.js
+++ b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/react/trackingGoals.js
@@ -1,3 +1,5 @@
+const { context } = useABSmartly();
+
const properties = {
price: 10000,
category: "5 stars",
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/ruby/trackingGoals.rb b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/ruby/trackingGoals.rb
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/ruby/trackingGoals.rb
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/ruby/trackingGoals.rb
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/swift/trackingGoals.swift b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/swift/trackingGoals.swift
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/swift/trackingGoals.swift
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/swift/trackingGoals.swift
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/vue/trackingGoals.js b/docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/vue/trackingGoals.js
similarity index 100%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/tracking-goals/vue/trackingGoals.js
rename to docs/APIs-and-SDKs/SDK-Documentation/_shared/tracking-goals/vue/trackingGoals.js
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage.mdx b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage.mdx
deleted file mode 100644
index 14480f1b..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage.mdx
+++ /dev/null
@@ -1,36 +0,0 @@
----
-sidebar_position: 3
----
-
-import SelectingATreatment from "./basic-usage/selecting-a-treatment/_selecting-a-treatment.mdx";
-
-import SelectingAVariable from "./basic-usage/selecting-a-variable/_selecting-a-variable.mdx";
-
-import Peeking from "./basic-usage/peeking/_peeking.mdx";
-
-import Overriding from "./basic-usage/overriding/_overriding.mdx";
-
-# Basic Usage
-
-After the init call, all the variants for all running experiments will be
-cached in memory. The init call should take a single-digit number of milliseconds on the
-server side. On the client side, it may take a little longer (it’s another
-roundtrip to the server) unless you pass the data directly in the HTML which
-makes it ready immediately. Any experiment that is evaluated and is not
-running will return Variant 0 (the control group).
-
-## Selecting a Treatment
-
-
-
-## Treatment Variables
-
-
-
-## Peek at Treatment Variants
-
-
-
-## Overriding Treatment Variants
-
-
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/_selecting-a-treatment.mdx b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/_selecting-a-treatment.mdx
deleted file mode 100644
index c5d9b9be..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/_selecting-a-treatment.mdx
+++ /dev/null
@@ -1,256 +0,0 @@
-import Tabs from "@theme/Tabs";
-import TabItem from "@theme/TabItem";
-import CodeBlock from "@theme/CodeBlock";
-
-import JsSelectingATreatment from "!!raw-loader!./js/selectingATreatment.js";
-
-import PythonSelectingATreatment from "!!raw-loader!./python/selectingATreatment.py";
-
-import ReactSelectingATreatment from "!!raw-loader!./react/selectingATreatment.js";
-import ReactUsingUseTreatment from "!!raw-loader!./react/usingUseTreatment.js";
-import ReactUsingTernaryOperator from "!!raw-loader!./react/usingTernaryOperator.js";
-
-import VueUsingTreatmentAlias from "!!raw-loader!./vue/UsingTreatmentAlias.vue";
-import VueUsingTreatmentIndex from "!!raw-loader!./vue/UsingTreatmentIndex.vue";
-import VueUsingOnlyDefaultSlot from "!!raw-loader!./vue/UsingOnlyDefaultSlot.vue";
-
-import SwiftSelectingATreatment from "!!raw-loader!./swift/selectingATreatment.swift";
-
-import JavaSelectingATreatment from "!!raw-loader!./java/selectingATreatment.java";
-
-import GoSelectingATreatment from "!!raw-loader!./go/selectingATreatment.go";
-
-import DotNetSelectingATreatment from "!!raw-loader!./dotnet/selectingATreatment.cs";
-
-import PHPSelectingATreatment from "!!raw-loader!./php/selectingATreatment.php";
-
-import RubySelectingATreatment from "!!raw-loader!./ruby/selectingATreatment.rb";
-
-import FlutterSelectingATreatment from "!!raw-loader!./flutter/selectingATreatment.dart";
-
-
-
-
-
-:::info
-To make sure the SDK is properly loaded before asking it for a treatment,
-block your code until the SDK is ready as shown below.
-
-The `ready()` method returns a promise. You can also just check if it is
-currently ready with the `isReady()` method.
-
-After the SDK is loaded you can use the `treatment()` method to return the proper
-treatment based on the `experiment_name` and the units data that was passed when
-the SDK was instantiated.
-
-Then use an `if-else-if-else` block as shown below and insert the code for the
-different treatments that you plan to create.
-:::
-
-{JsSelectingATreatment}
-
-
-
-
-
-{PythonSelectingATreatment}
-
-
-
-
-
-#### Using the Treatment component
-
-In React, the easiest way to select your treatment is to use the `useTreatment`
-hook.
-
-{ReactUsingUseTreatment}
-
-Or, you can use the `Treatment` and `TreatmentVariant` components.
-
-{ReactSelectingATreatment}
-
-:::note
-If the loading prop is not provided the default variant will be shown instead.
-:::
-
-#### Using the ternary operator
-
-If you need some more control over the way your variants are rendered, you can
-use the `TreatmentFunction` component and the ternary operator, like so:
-
-{ReactUsingTernaryOperator}
-
-
-
-
-
-
-
-{SwiftSelectingATreatment}
-
-
-
-
-
-The preferred method to select a treatment is using the `Treatment` component
-with a named and scoped slot per treatment.
-
-:::info The slot selection rules are as follows
-
-- If the context is not ready:
- - If the loading slot exists, select it.
- - Otherwise, select the default slot.
-- Otherwise, if the context is ready:
- - If a slot with the treatment alias (A, B, C, ...) exists, select it.
- - Otherwise, if a slot with the treatment index exists, select it.
- - Otherwise, select the default.
-- If the selected slot doesn't exist, nothing will be rendered.
-
-:::
-
-**Example using the treatment alias**
-
-{VueUsingTreatmentAlias}
-
-**Example using the treatment index**
-
-{VueUsingTreatmentIndex}
-
-**Example using only the default slot**
-
-{VueUsingOnlyDefaultSlot}
-
-:::info
-The scoped slot properties contain information about the ABsmartly context
-and the selected treatment:
-
-```json
-{
- "treatment": 1,
- "config": {
- "color": "red"
- },
- "ready": true,
- "failed": false
-}
-```
-
-If the experiment is not running, or the context creation failed, the slot
-will be rendered with the following properties:
-
-```json
-{
- "treatment": 0,
- "config": {},
- "ready": true,
- "failed": false
-}
-```
-
-:::
-
-
-
-
-
-The preferred method to select a treatment is using the `Treatment` component
-with a named and scoped slot per treatment.
-
-:::info The slot selection rules are as follows
-
-- If the context is not ready:
- - If the loading slot exists, select it.
- - Otherwise, select the default slot.
-- Otherwise, if the context is ready:
- - If a slot with the treatment alias (A, B, C, ...) exists, select it.
- - Otherwise, if a slot with the treatment index exists, select it.
- - Otherwise, select the default.
-- If the selected slot doesn't exist, nothing will be rendered.
-
-:::
-
-**Example using the treatment alias**
-
-{VueUsingTreatmentAlias}
-
-**Example using the treatment index**
-
-{VueUsingTreatmentIndex}
-
-**Example using only the default slot**
-
-{VueUsingOnlyDefaultSlot}
-
-:::info
-The scoped slot properties contain information about the ABsmartly context
-and the selected treatment:
-
-```json
-{
- "treatment": 1,
- "config": {
- "color": "red"
- },
- "ready": true,
- "failed": false
-}
-```
-
-If the experiment is not running, or the context creation failed, the slot
-will be rendered with the following properties:
-
-```json
-{
- "treatment": 0,
- "config": {},
- "ready": true,
- "failed": false
-}
-```
-
-:::
-
-
-
-
-
-
-
-{JavaSelectingATreatment}
-
-
-
-
-
-
-
-{GoSelectingATreatment}
-
-
-
-
-
-{DotNetSelectingATreatment}
-
-
-
-
-
-{PHPSelectingATreatment}
-
-
-
-
-
-{RubySelectingATreatment}
-
-
-
-
-
-{FlutterSelectingATreatment}
-
-
-
-
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/dotnet/selectingATreatment.cs b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/dotnet/selectingATreatment.cs
deleted file mode 100644
index 13b02b56..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/dotnet/selectingATreatment.cs
+++ /dev/null
@@ -1,5 +0,0 @@
- if (context.GetTreatment("exp_test_experiment") == 0) {
- // user is in control group (variant 0)
- } else {
- // user is in treatment group
- }
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/flutter/selectingATreatment.dart b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/flutter/selectingATreatment.dart
deleted file mode 100644
index ebd2d329..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/flutter/selectingATreatment.dart
+++ /dev/null
@@ -1,5 +0,0 @@
- if((await context.getTreatment("exp_test_experiment") == 0) {
- // user is in control group (variant 0)
- } else {
- // user is in treatment group
- }
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/go/selectingATreatment.go b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/go/selectingATreatment.go
deleted file mode 100644
index 08d7f665..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/go/selectingATreatment.go
+++ /dev/null
@@ -1,6 +0,0 @@
-var res, _ = context.GetTreatment("exp_test_experiment")
-if res == 0 {
- // user is in control group (variant 0)
-} else {
- // user is in treatment group
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/java/selectingATreatment.java b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/java/selectingATreatment.java
deleted file mode 100644
index fa4ab8ad..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/java/selectingATreatment.java
+++ /dev/null
@@ -1,5 +0,0 @@
- if (context.getTreatment("exp_test_experiment") == 0) {
- // user is in control group (variant 0)
- } else {
- // user is in treatment group
- }
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/js/selectingATreatment.js b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/js/selectingATreatment.js
deleted file mode 100644
index 2461b675..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/js/selectingATreatment.js
+++ /dev/null
@@ -1,25 +0,0 @@
-context.ready().then(function () {
- const variant = context.treatment("experiment_name");
- // A/B/C Test
- if (variant === 1) {
- // insert code to show on variant 1
- } else if (variant === 2) {
- // insert code to show on variant 2
- } else {
- // insert the control treatment code
- }
-});
-
-// or using async/await
-async function runExperiment() {
- await context.ready();
-
- const variant = context.treatment("experiment_name");
-
- // A/B Test
- if (variant) {
- // insert code to show on variant 1
- } else {
- // insert the control treatment code
- }
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/php/selectingATreatment.php b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/php/selectingATreatment.php
deleted file mode 100644
index 134d923e..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/php/selectingATreatment.php
+++ /dev/null
@@ -1,8 +0,0 @@
-$treatment = $context->getTreatment('exp_test_experiment');
-
-if ($treatment === 0) {
- // user is in control group (variant 0)
-}
-else {
- // user is in treatment group
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/python/selectingATreatment.py b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/python/selectingATreatment.py
deleted file mode 100644
index 9b61850c..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/python/selectingATreatment.py
+++ /dev/null
@@ -1,5 +0,0 @@
- res, _ = context.get_treatment("exp_test_experiment")
- if res == 0:
- # user is in control group (variant 0)
- else:
- # user is in treatment group
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/react/usingUseTreatment.js b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/react/usingUseTreatment.js
deleted file mode 100644
index e476a06e..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/react/usingUseTreatment.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const MyComponent = () => {
- const {
- variant,
- // loading,
- // error,
- // context
- } = useTreatment("experiment_name");
-
- if (variant === 1) return ;
- if (variant === 2) return ;
- if (variant === 3) return ;
-
- // `variant` is 0
- return ;
-};
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/ruby/selectingATreatment.rb b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/ruby/selectingATreatment.rb
deleted file mode 100644
index ab94de80..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/ruby/selectingATreatment.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-treatment = context.treatment('exp_test_experiment')
-
-if treatment.zero?
- # user is in control group (variant 0)
-else
- # user is in treatment group
-end
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/swift/selectingATreatment.swift b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/swift/selectingATreatment.swift
deleted file mode 100644
index 1292ce04..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/swift/selectingATreatment.swift
+++ /dev/null
@@ -1,6 +0,0 @@
-let treatment = context.getTreatment("exp_test_experiment")
-if treatment == 0 {
- // user is in control group (variant 0)
-} else {
- // user is in treatment group
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/vue/UsingTreatmentAlias.vue b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/vue/UsingTreatmentAlias.vue
deleted file mode 100644
index 1cac3fc9..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-treatment/vue/UsingTreatmentAlias.vue
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/_selecting-a-variable.mdx b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/_selecting-a-variable.mdx
deleted file mode 100644
index 11eeafaa..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/_selecting-a-variable.mdx
+++ /dev/null
@@ -1,152 +0,0 @@
-import Tabs from "@theme/Tabs";
-import TabItem from "@theme/TabItem";
-import CodeBlock from "@theme/CodeBlock";
-import Image from "@theme/IdealImage";
-
-import ConfigApi from "../config-api/_config-api.mdx";
-
-import JsSelectingAVariable from "!!raw-loader!./js/selectingAVariable.js";
-
-import PythonSelectingAVariable from "!!raw-loader!./python/selectingAVariable.py";
-
-import ReactDirectlyInTreatmentComponent from "!!raw-loader!./react/directlyInTreatmentComponent.js";
-import ReactUsingUseEffect from "!!raw-loader!./react/inUseEffect.js";
-
-import SwiftSelectingAVariable from "!!raw-loader!./swift/selectingAVariable.swift";
-
-import VueSelectingAVariable from "!!raw-loader!./vue/selectingAVariable.js";
-
-import JavaSelectingAVariable from "!!raw-loader!./java/selectingAVariable.java";
-
-import GoSelectingAVariable from "!!raw-loader!./go/selectingAVariable.go";
-
-import DotNetSelectingAVariable from "!!raw-loader!./dotnet/selectingAVariable.cs";
-
-import PHPSelectingAVariable from "!!raw-loader!./php/selectingAVariable.php";
-
-import RubySelectingAVariable from "!!raw-loader!./ruby/selectingAVariable.rb";
-
-import FlutterSelectingAVariable from "!!raw-loader!./flutter/selectingAVariable.dart";
-
-Treatment variables are a powerful tool that can be used to automate your experiments.
-When creating an experiment on your ABsmartly Web Console, you can give each variant
-a set of variables. You can then use your context to pull the values of these variables
-into your code.
-
-For example, let's say you have an experiment to find out what color of
-button generates the most clicks on your homepage. In this experiment, you have
-two variants - _Variant 1_ and _Variant 2_. On both of these variants, you
-have assigned a variable:
-
-- **_Variant 1:_** `{ "button.color": "green" }`
-- **_Variant 2:_** `{ "button.color": "blue" }`
-
-And you wish for the control group **_(Variant 0)_** to have `{ "button.color": red }`.
-
-
-
-You can select these values in your code like so:
-
-
-
-
-
-{JsSelectingAVariable}
-
-
-
-
-
-
-
-{PythonSelectingAVariable}
-
-
-
-
-
-#### Directly in the `TreatmentFunction` component
-
-{ReactDirectlyInTreatmentComponent}
-
-#### In a useEffect()
-
-{ReactUsingUseEffect}
-
-:::note Without react hooks
-This can be accomplished in a class component without using react hooks.
-Replace the above useEffect hook with a `componentDidMount` lifecycle hook and
-store the variables in your component's state there.
-:::
-
-
-
-
-
-{SwiftSelectingAVariable}
-
-
-
-
-
-{VueSelectingAVariable}
-
-
-
-
-
-{VueSelectingAVariable}
-
-
-
-
-
-{JavaSelectingAVariable}
-
-
-
-
-
-{GoSelectingAVariable}
-
-
-
-
-
-{DotNetSelectingAVariable}
-
-
-
-
-
-{PHPSelectingAVariable}
-
-
-
-
-
-{RubySelectingAVariable}
-
-
-
-
-
-{FlutterSelectingAVariable}
-
-
-
-
-
-:::caution
-We recommend that control group does not have variables set on the Web
-Console except in very specific use cases. Usually, they should be set using
-the "default value" parameter as shown above.
-:::
-
-You can then use this variable to style your button appropriately for the
-variant that the current user is on. The benefit of this is that you can now
-make more variants of this experiment on the Web Console and they will
-automatically be implemented in your application!
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/dotnet/selectingAVariable.cs b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/dotnet/selectingAVariable.cs
deleted file mode 100644
index 7ff63e4d..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/dotnet/selectingAVariable.cs
+++ /dev/null
@@ -1 +0,0 @@
- var variable = context.GetVariableValue("my_variable");
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/flutter/selectingAVariable.dart b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/flutter/selectingAVariable.dart
deleted file mode 100644
index caf9bc8f..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/flutter/selectingAVariable.dart
+++ /dev/null
@@ -1,3 +0,0 @@
-var defaultButtonColorValue = "red"
-
-context.getVariableValue("button.color", defaultButtonColorValue)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/go/selectingAVariable.go b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/go/selectingAVariable.go
deleted file mode 100644
index e715ca2f..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/go/selectingAVariable.go
+++ /dev/null
@@ -1,3 +0,0 @@
-var defaultButtonColorValue = "red"
-
-var buttonColor, _ = context.GetVariableValue("button.color", defaultButtonColorValue)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/java/selectingAVariable.java b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/java/selectingAVariable.java
deleted file mode 100644
index c9117b2c..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/java/selectingAVariable.java
+++ /dev/null
@@ -1,3 +0,0 @@
-final String defaultButtonColorValue = "red";
-
-final Object buttonColor = context.getVariableValue("button.color", defaultButtonColorValue);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/js/selectingAVariable.js b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/js/selectingAVariable.js
deleted file mode 100644
index 5774b355..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/js/selectingAVariable.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const defaultButtonColorValue = "red";
-
-const buttonColor = context.variableValue(
- "button.color",
- defaultButtonColorValue
-);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/php/selectingAVariable.php b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/php/selectingAVariable.php
deleted file mode 100644
index 3bbd6ef2..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/php/selectingAVariable.php
+++ /dev/null
@@ -1,2 +0,0 @@
-$defaultButtonColorValue = 'red';
-$buttonColor = $context->getVariableValue('button.color');
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/python/selectingAVariable.py b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/python/selectingAVariable.py
deleted file mode 100644
index 1bd1e7e8..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/python/selectingAVariable.py
+++ /dev/null
@@ -1 +0,0 @@
- res = context.get_variable_value(key, 17)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/react/inUseEffect.js b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/react/inUseEffect.js
deleted file mode 100644
index cc702027..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/react/inUseEffect.js
+++ /dev/null
@@ -1,13 +0,0 @@
-const [buttonColor, setButtonColor] = React.useState("red");
-
-useEffect(() => {
- const defaultButtonColorValue = "red";
- context
- .ready()
- .then(() => {
- setButtonColor(
- context.variableValue("button.color", defaultButtonColorValue)
- );
- })
- .catch((error) => console.error(error));
-}, [context]);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/ruby/selectingAVariable.rb b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/ruby/selectingAVariable.rb
deleted file mode 100644
index 2608cb8c..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/ruby/selectingAVariable.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-default_button_color_value = 'red'
-
-context.variable_value('button.color', default_button_color_value)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/swift/selectingAVariable.swift b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/swift/selectingAVariable.swift
deleted file mode 100644
index 0e33a82b..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/swift/selectingAVariable.swift
+++ /dev/null
@@ -1 +0,0 @@
-let buttonColor = context.getVariableValue("button.color", defaultValue: "red")
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/vue/selectingAVariable.js b/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/vue/selectingAVariable.js
deleted file mode 100644
index 5e42de1d..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/basic-usage/selecting-a-variable/vue/selectingAVariable.js
+++ /dev/null
@@ -1,6 +0,0 @@
-const defaultButtonColorValue = "red";
-
-const buttonColor = this.$absmartly.variableValue(
- "button.color",
- defaultButtonColorValue
-);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/checking-variants-without-exposures.mdx b/docs/APIs-and-SDKs/SDK-Documentation/checking-variants-without-exposures.mdx
new file mode 100644
index 00000000..da55ed22
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/checking-variants-without-exposures.mdx
@@ -0,0 +1,51 @@
+---
+sidebar_position: 7
+---
+
+import Peeking from "./_shared/peeking/_peeking.mdx";
+
+# Checking Variants Without Triggering Exposures
+
+When you call `treatment()`, the SDK records an **exposure**, telling ABsmartly that this
+user saw the experiment. That's usually what you want. But sometimes you need to know
+which variant a user is in without counting it as an exposure.
+
+The `peek()` method does exactly this. It returns the same variant number as
+`treatment()`, but silently, without recording anything.
+
+## When to use peek
+
+Here are some real scenarios where peeking makes sense:
+
+- **Pre-loading assets.** You need to know the variant ahead of time to prefetch images,
+ scripts, or data. The actual exposure should be recorded later when the user sees the
+ content.
+- **Server-side routing with client-side exposure.** Your server decides which page
+ template to render based on the variant, but the exposure should only fire on the
+ client where the user actually sees it.
+- **Debug logging.** You want to log which variant a user is in for debugging, but you
+ don't want that logging to affect the experiment by creating exposures.
+- **Admin panels.** An internal dashboard shows the current state of experiments for a
+ user. Looking at this state shouldn't count as an exposure.
+
+:::caution
+If you peek but never call `treatment()` for the same experiment, no exposure will be
+recorded. That user won't appear in your experiment results at all. Make sure that
+somewhere in your code, `treatment()` gets called for users who actually see the
+experiment.
+:::
+
+:::tip React users
+You can also peek using the `useTreatment` hook by passing `true` as the second
+argument:
+
+```jsx
+import { useTreatment } from "@absmartly/react-sdk";
+
+const { variant } = useTreatment("experiment_name", true);
+```
+
+This returns the variant without recording an exposure, just like `context.peek()`.
+:::
+
+
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/_complete-example.mdx b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/_complete-example.mdx
new file mode 100644
index 00000000..dc2ef0ea
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/_complete-example.mdx
@@ -0,0 +1,68 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import CodeBlock from "@theme/CodeBlock";
+
+import JsCompleteExample from "!!raw-loader!./js/completeExample.js";
+import PythonCompleteExample from "!!raw-loader!./python/completeExample.py";
+import ReactCompleteExample from "!!raw-loader!./react/completeExample.jsx";
+import VueCompleteExample from "!!raw-loader!./vue/completeExample.js";
+import Vue3CompleteExample from "!!raw-loader!./vue3/completeExample.js";
+import SwiftCompleteExample from "!!raw-loader!./swift/completeExample.swift";
+import JavaCompleteExample from "!!raw-loader!./java/completeExample.java";
+import GoCompleteExample from "!!raw-loader!./go/completeExample.go";
+import DotNetCompleteExample from "!!raw-loader!./dotnet/completeExample.cs";
+import PHPCompleteExample from "!!raw-loader!./php/completeExample.php";
+import RubyCompleteExample from "!!raw-loader!./ruby/completeExample.rb";
+import FlutterCompleteExample from "!!raw-loader!./flutter/completeExample.dart";
+
+
+
+
+{JsCompleteExample}
+
+
+
+{PythonCompleteExample}
+
+
+
+{ReactCompleteExample}
+
+
+
+{SwiftCompleteExample}
+
+
+
+{VueCompleteExample}
+
+
+
+{Vue3CompleteExample}
+
+
+
+{JavaCompleteExample}
+
+
+
+{GoCompleteExample}
+
+
+
+{DotNetCompleteExample}
+
+
+
+{PHPCompleteExample}
+
+
+
+{RubyCompleteExample}
+
+
+
+{FlutterCompleteExample}
+
+
+
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/dotnet/completeExample.cs b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/dotnet/completeExample.cs
new file mode 100644
index 00000000..ce77d42b
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/dotnet/completeExample.cs
@@ -0,0 +1,58 @@
+using ABSmartly;
+using Microsoft.Extensions.DependencyInjection;
+
+// Initialize the SDK
+var serviceProvider = new ServiceCollection()
+ .AddHttpClient()
+ .BuildServiceProvider();
+
+var httpClientFactory = serviceProvider
+ .GetRequiredService();
+
+var abSdk = new ABSdk(
+ new ABSdkHttpClientFactory(httpClientFactory),
+ new ABSmartlyServiceConfiguration
+ {
+ Environment = "production",
+ Application = "website",
+ Endpoint = "https://your-company.absmartly.io/v1",
+ ApiKey = "YOUR-API-KEY"
+ });
+
+// Create a context for this user
+var config = new ContextConfig()
+ .SetUnit("user_id", "user-12345");
+
+// Using the disposable pattern ensures events are flushed on close
+using var context = abSdk.CreateContext(config);
+await context.WaitUntilReady();
+
+// Check which variant the user is in
+if (context.GetTreatment("homepage_banner_experiment") == 1)
+{
+ // Variant B: show a personalized banner
+ ShowBanner("Welcome back, we have new deals for you!");
+}
+else
+{
+ // Variant A (control): show the existing banner
+ ShowBanner("Welcome back!");
+}
+
+// Use a variable set in the Web Console for more flexibility
+var buttonColor = context.GetVariableValue("button.color", "blue");
+SetButtonColor(buttonColor);
+
+// Track when the user completes a key action
+context.Track("cta_click", new Dictionary
+{
+ { "page", "homepage" }
+});
+
+// Track a purchase with revenue data
+context.Track("purchase", new Dictionary
+{
+ { "revenue", 49.99 },
+ { "item_count", 3 }
+});
+// Context is automatically closed and flushed by the using statement
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/flutter/completeExample.dart b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/flutter/completeExample.dart
new file mode 100644
index 00000000..83820ff7
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/flutter/completeExample.dart
@@ -0,0 +1,51 @@
+import 'package:absmartly_sdk/absmartly_sdk.dart';
+
+void main() async {
+ // Initialize the SDK
+ final ClientConfig clientConfig = ClientConfig()
+ ..setEndpoint("https://your-company.absmartly.io/v1")
+ ..setAPIKey("YOUR-API-KEY")
+ ..setApplication("website")
+ ..setEnvironment("production");
+
+ final ABSmartly sdk = ABSmartly(
+ ABSmartlyConfig.create()
+ .setClient(Client.create(clientConfig)),
+ );
+
+ // Create a context for this user
+ final ContextConfig contextConfig = ContextConfig.create()
+ .setUnit("user_id", "user-12345");
+ final Context context = await sdk
+ .createContext(contextConfig)
+ .waitUntilReady();
+
+ // Check which variant the user is in
+ final int treatment =
+ await context.getTreatment("homepage_banner_experiment");
+
+ if (treatment == 1) {
+ // Variant B: show a personalized banner
+ showBanner("Welcome back, we have new deals for you!");
+ } else {
+ // Variant A (control): show the existing banner
+ showBanner("Welcome back!");
+ }
+
+ // Use a variable set in the Web Console for more flexibility
+ final String buttonColor =
+ await context.getVariableValue("button.color", "blue");
+ setButtonColor(buttonColor);
+
+ // Track when the user completes a key action
+ context.track("cta_click", {"page": "homepage"});
+
+ // Track a purchase with revenue data
+ context.track("purchase", {
+ "revenue": 49.99,
+ "item_count": 3,
+ });
+
+ // Close the context to flush remaining events
+ await context.close();
+}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/go/completeExample.go b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/go/completeExample.go
new file mode 100644
index 00000000..324c0255
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/go/completeExample.go
@@ -0,0 +1,69 @@
+package main
+
+import (
+ "fmt"
+ "os"
+
+ absmartly "github.com/absmartly/go-sdk"
+)
+
+func main() {
+ // Initialize the SDK
+ clientConfig := absmartly.ClientConfig{
+ Endpoint_: "https://your-company.absmartly.io/v1",
+ ApiKey_: os.Getenv("ABSMARTLY_APIKEY"),
+ Application_: "website",
+ Environment_: "production",
+ }
+
+ sdkConfig := absmartly.ABSmartlyConfig{
+ Client_: absmartly.CreateDefaultClient(clientConfig),
+ }
+ sdk := absmartly.Create(sdkConfig)
+
+ // Create a context for this user
+ contextConfig := absmartly.ContextConfig{
+ Units_: map[string]string{
+ "user_id": "user-12345",
+ },
+ }
+ ctx := sdk.CreateContext(contextConfig)
+ ctx.WaitUntilReady()
+
+ // Check which variant the user is in
+ treatment, err := ctx.GetTreatment("homepage_banner_experiment")
+ if err != nil {
+ fmt.Println("Error getting treatment:", err)
+ return
+ }
+
+ if treatment == 1 {
+ // Variant B: show a personalized banner
+ showBanner("Welcome back, we have new deals for you!")
+ } else {
+ // Variant A (control): show the existing banner
+ showBanner("Welcome back!")
+ }
+
+ // Use a variable set in the Web Console for more flexibility
+ buttonColor, err := ctx.GetVariableValue("button.color", "blue")
+ if err != nil {
+ fmt.Println("Error getting variable:", err)
+ return
+ }
+ setButtonColor(buttonColor)
+
+ // Track when the user completes a key action
+ ctx.Track("cta_click", map[string]interface{}{
+ "page": "homepage",
+ })
+
+ // Track a purchase with revenue data
+ ctx.Track("purchase", map[string]interface{}{
+ "revenue": 49.99,
+ "item_count": 3,
+ })
+
+ // Close the context to flush remaining events
+ ctx.Close()
+}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/java/completeExample.java b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/java/completeExample.java
new file mode 100644
index 00000000..9133b5d0
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/java/completeExample.java
@@ -0,0 +1,47 @@
+import com.absmartly.sdk.*;
+import java.util.Map;
+
+public class ExperimentExample {
+ public static void main(String[] args) {
+ // Initialize the SDK
+ final ClientConfig clientConfig = ClientConfig.create()
+ .setEndpoint("https://your-company.absmartly.io/v1")
+ .setAPIKey("YOUR-API-KEY")
+ .setApplication("website")
+ .setEnvironment("production");
+
+ final Client client = Client.create(clientConfig);
+ final ABSmartlyConfig config = ABSmartlyConfig.create()
+ .setClient(client);
+ final ABSmartly sdk = ABSmartly.create(config);
+
+ // Create a context for this user
+ final ContextConfig contextConfig = ContextConfig.create()
+ .setUnit("user_id", "user-12345");
+ try (final Context context = sdk.createContext(contextConfig)
+ .waitUntilReady()) {
+
+ // Check which variant the user is in
+ if (context.getTreatment("homepage_banner_experiment") == 1) {
+ // Variant B: show a personalized banner
+ showBanner("Welcome back, we have new deals for you!");
+ } else {
+ // Variant A (control): show the existing banner
+ showBanner("Welcome back!");
+ }
+
+ // Use a variable set in the Web Console for more flexibility
+ String buttonColor = context.getVariableValue("button.color", "blue");
+ setButtonColor(buttonColor);
+
+ // Track when the user completes a key action
+ context.track("cta_click", Map.of("page", "homepage"));
+
+ // Track a purchase with revenue data
+ context.track("purchase", Map.of(
+ "revenue", 49.99,
+ "item_count", 3
+ ));
+ }
+ }
+}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/js/completeExample.js b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/js/completeExample.js
new file mode 100644
index 00000000..91c15331
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/js/completeExample.js
@@ -0,0 +1,54 @@
+const absmartly = require("@absmartly/javascript-sdk");
+
+// Initialize the SDK
+const sdk = new absmartly.SDK({
+ endpoint: "https://your-company.absmartly.io/v1",
+ apiKey: "YOUR-API-KEY",
+ environment: "production",
+ application: "website",
+});
+
+// Create a context for this user
+const request = {
+ units: {
+ user_id: "user-12345",
+ },
+};
+
+const context = sdk.createContext(request);
+
+context.ready().then(() => {
+ // Check which variant the user is in
+ const treatment = context.treatment("homepage_banner_experiment");
+
+ if (treatment === 1) {
+ // Variant B: show a personalized banner
+ showBanner("Welcome back, we have new deals for you!");
+ } else {
+ // Variant A (control): show the existing banner
+ showBanner("Welcome back!");
+ }
+
+ // Use a variable set in the Web Console for more flexibility
+ const buttonColor = context.variableValue("button.color", "blue");
+ setButtonColor(buttonColor);
+
+ // Track when the user clicks the CTA button
+ document.getElementById("cta-button").addEventListener("click", () => {
+ context.track("cta_click", { page: "homepage" });
+ });
+
+ // Track a purchase with revenue data
+ onPurchaseComplete((order) => {
+ context.track("purchase", {
+ revenue: order.total,
+ item_count: order.items.length,
+ });
+ });
+});
+
+// When the user leaves or the app shuts down, finalize the context
+// to flush any remaining events
+window.addEventListener("beforeunload", () => {
+ context.finalize();
+});
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/php/completeExample.php b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/php/completeExample.php
new file mode 100644
index 00000000..be18385b
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/php/completeExample.php
@@ -0,0 +1,44 @@
+setUnit('user_id', 'user-12345');
+$context = $sdk->createContext($contextConfig);
+
+// Check which variant the user is in
+$treatment = $context->getTreatment('homepage_banner_experiment');
+
+if ($treatment === 1) {
+ // Variant B: show a personalized banner
+ showBanner('Welcome back, we have new deals for you!');
+} else {
+ // Variant A (control): show the existing banner
+ showBanner('Welcome back!');
+}
+
+// Use a variable set in the Web Console for more flexibility
+$buttonColor = $context->getVariableValue('button.color', 'blue');
+setButtonColor($buttonColor);
+
+// Track when the user completes a key action
+$context->track('cta_click', (object) ['page' => 'homepage']);
+
+// Track a purchase with revenue data
+$context->track('purchase', (object) [
+ 'revenue' => 49.99,
+ 'item_count' => 3,
+]);
+
+// Close the context to flush remaining events
+$context->close();
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/python/completeExample.py b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/python/completeExample.py
new file mode 100644
index 00000000..01757443
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/python/completeExample.py
@@ -0,0 +1,44 @@
+from absmartly import ClientConfig, Client, DefaultHTTPClient, DefaultHTTPClientConfig, ABSmartlyConfig, ABSmartly, ContextConfig
+
+# Initialize the SDK
+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)
+
+# Create a context for this user
+context_config = ContextConfig()
+context_config.units = {"user_id": "user-12345"}
+context = sdk.create_context(context_config)
+context.wait_until_ready()
+
+# Check which variant the user is in
+treatment = context.get_treatment("homepage_banner_experiment")
+
+if treatment == 1:
+ # Variant B: show a personalized banner
+ show_banner("Welcome back, we have new deals for you!")
+else:
+ # Variant A (control): show the existing banner
+ show_banner("Welcome back!")
+
+# Use a variable set in the Web Console for more flexibility
+button_color = context.get_variable_value("button.color", "blue")
+set_button_color(button_color)
+
+# Track when the user completes a key action
+context.track("cta_click", {"page": "homepage"})
+
+# Track a purchase with revenue data
+context.track("purchase", {
+ "revenue": 49.99,
+ "item_count": 3,
+})
+
+# Close the context to flush remaining events
+context.close()
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/react/completeExample.jsx b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/react/completeExample.jsx
new file mode 100644
index 00000000..4d82a79f
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/react/completeExample.jsx
@@ -0,0 +1,70 @@
+// This example shows multiple React patterns - pick the one that fits your component
+import ABSmartly, {
+ Treatment,
+ TreatmentVariant,
+ useABSmartly,
+ useTreatment,
+} from "@absmartly/react-sdk";
+
+function App() {
+ const sdkOptions = {
+ endpoint: "https://your-company.absmartly.io/v1",
+ apiKey: "YOUR-API-KEY",
+ environment: "production",
+ application: "website",
+ };
+
+ const contextOptions = {
+ units: { user_id: "user-12345" },
+ };
+
+ return (
+
+
+
+ );
+}
+
+function CtaButton({ onClick }) {
+ const { variant } = useTreatment("cta_color_experiment");
+
+ const color = variant === 1 ? "blue" : "green";
+
+ return (
+
+ );
+}
+
+function Homepage() {
+ const { context } = useABSmartly();
+
+ const handleCtaClick = () => {
+ context.track("cta_click", { page: "homepage" });
+ };
+
+ const handlePurchase = (order) => {
+ context.track("purchase", {
+ revenue: order.total,
+ item_count: order.items.length,
+ });
+ };
+
+ return (
+
+ );
+}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/ruby/completeExample.rb b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/ruby/completeExample.rb
new file mode 100644
index 00000000..f70c6ed6
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/ruby/completeExample.rb
@@ -0,0 +1,42 @@
+require "absmartly"
+
+# Initialize the SDK
+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
+
+# Create a context for this user
+context_config = Absmartly.create_context_config
+context_config.units = { user_id: "user-12345" }
+context = Absmartly.create_context(context_config)
+context.wait_until_ready
+
+# Check which variant the user is in
+treatment = context.treatment("homepage_banner_experiment")
+
+if treatment == 1
+ # Variant B: show a personalized banner
+ show_banner("Welcome back, we have new deals for you!")
+else
+ # Variant A (control): show the existing banner
+ show_banner("Welcome back!")
+end
+
+# Use a variable set in the Web Console for more flexibility
+button_color = context.variable_value("button.color", "blue")
+set_button_color(button_color)
+
+# Track when the user completes a key action
+context.track("cta_click", { page: "homepage" })
+
+# Track a purchase with revenue data
+context.track("purchase", {
+ revenue: 49.99,
+ item_count: 3,
+})
+
+# Close the context to flush remaining events
+context.close
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/swift/completeExample.swift b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/swift/completeExample.swift
new file mode 100644
index 00000000..621e0890
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/swift/completeExample.swift
@@ -0,0 +1,47 @@
+import ABSmartly
+
+// Initialize the SDK
+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.create()
+sdkConfig.client = client
+let sdk = try ABSmartlySDK(config: sdkConfig)
+
+// Create a context for this user
+let contextConfig = ContextConfig()
+contextConfig.setUnit(unitType: "user_id", uid: "user-12345")
+let context = sdk.createContext(config: contextConfig)
+
+context.waitUntilReady().done { context in
+ // Check which variant the user is in
+ let treatment = context.getTreatment("homepage_banner_experiment")
+
+ if treatment == 1 {
+ // Variant B: show a personalized banner
+ showBanner("Welcome back, we have new deals for you!")
+ } else {
+ // Variant A (control): show the existing banner
+ showBanner("Welcome back!")
+ }
+
+ // Use a variable set in the Web Console for more flexibility
+ let buttonColor = context.getVariableValue("button.color", defaultValue: "blue")
+ setButtonColor(buttonColor)
+
+ // Track when the user completes a key action
+ context.track("cta_click", properties: ["page": "homepage"])
+
+ // Track a purchase with revenue data
+ context.track("purchase", properties: [
+ "revenue": 49.99,
+ "item_count": 3
+ ])
+
+ // Close the context when done to flush remaining events
+ context.close()
+}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/vue/completeExample.js b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/vue/completeExample.js
new file mode 100644
index 00000000..8d0e162d
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/vue/completeExample.js
@@ -0,0 +1,51 @@
+// main.js - Initialize the SDK as a Vue plugin
+import Vue from "vue";
+import App from "./App.vue";
+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" },
+ },
+ attributes: {
+ user_agent: navigator.userAgent,
+ },
+});
+
+new Vue({ render: (h) => h(App) }).$mount("#app");
+
+// In your component, use treatments and track goals:
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/complete-example/vue3/completeExample.js b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/vue3/completeExample.js
new file mode 100644
index 00000000..b8c2b075
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/complete-example/vue3/completeExample.js
@@ -0,0 +1,53 @@
+// main.js - Initialize the SDK as a Vue plugin
+import { createApp } from "vue";
+import App from "./App.vue";
+import absmartly from "@absmartly/vue3-sdk";
+
+const app = createApp(App);
+
+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,
+ },
+});
+
+app.mount("#app");
+
+// In your component, use treatments and track goals:
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/config-api.mdx b/docs/APIs-and-SDKs/SDK-Documentation/config-api.mdx
new file mode 100644
index 00000000..6691efcb
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/config-api.mdx
@@ -0,0 +1,76 @@
+---
+sidebar_position: 10
+---
+
+import ConfigApi from "./_shared/config-api/_config-api.mdx";
+
+# Config API
+
+If your application already uses configuration objects to control behaviour (feature flags,
+theme settings, copy, layout), the Config API lets you run experiments on those config
+values with zero additional branching logic.
+
+Instead of writing `if treatment === 1 then color = green`, you just merge your config
+with experiment data and your existing config-driven code handles the rest. This means
+you can set up new experiments from the Web Console without touching a single line of
+application code.
+
+:::info
+The Config API is currently available in the **Javascript SDK** only.
+:::
+
+## What it replaces
+
+Say your app has a config object that controls the homepage. Without the Config API,
+you'd branch on every experiment manually:
+
+```js
+const config = {
+ hero_image: context.treatment("homepage_hero") === 1
+ ? "http://cdn.com/hero-new.png"
+ : "http://cdn.com/hero-default.png",
+ button: {
+ color: context.treatment("homepage_hero") === 1 ? "green" : "blue",
+ cta: context.treatment("homepage_hero") === 1 ? "Start free trial" : "Learn more",
+ },
+};
+```
+
+With `mergeConfig()`, you define your defaults and the SDK merges in the experiment
+values automatically. In the Web Console, you'd set treatment variables that match
+your config keys (e.g. `hero_image`, `button.color`, `button.cta`):
+
+```js
+import { mergeConfig } from "@absmartly/javascript-sdk";
+
+let config = {
+ hero_image: "http://cdn.com/hero-default.png",
+ button: {
+ color: "blue",
+ cta: "Learn more",
+ },
+};
+
+config = mergeConfig(context, config);
+// config.button.color is now a getter that returns the experiment's value
+// and calls treatment() automatically, so exposures are tracked for you
+```
+
+No branching logic in your code. New experiments can be set up entirely from the Web
+Console by adding variables that match your config keys.
+
+## How it works
+
+The `mergeConfig()` function takes a context and your existing config object, and returns
+a new one where any keys that match experiment variables are replaced with getters. When
+those keys are accessed, the SDK automatically calls `treatment()` under the hood, so
+exposures are tracked without you having to think about it.
+
+
+
+## Next steps
+
+You've reached the end of the SDK Guide. For per-SDK API details beyond what's
+covered here, check the README in each SDK's GitHub repository (linked on the
+[SDK Guide overview](./)). If you have questions, reach out to our team through
+the Web Console.
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started.mdx b/docs/APIs-and-SDKs/SDK-Documentation/getting-started.mdx
index 94700a92..780a94fc 100644
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started.mdx
+++ b/docs/APIs-and-SDKs/SDK-Documentation/getting-started.mdx
@@ -2,25 +2,59 @@
sidebar_position: 2
---
-import Install from "./getting-started/install/_install.mdx";
-import ImportAndInitialize from "./getting-started/import-and-initialize/_import-and-initialize.mdx";
-import CreateNewContextRequest from "./getting-started/create-new-context-request/_create-new-context-request.mdx";
-import CustomEventLogger from "./getting-started/custom-event-logger/_custom-event-logger.mdx";
+import Install from "./_shared/install/_install.mdx";
+import InitializeBasic from "./_initialize-basic.mdx";
+import CreateContextBasic from "./_create-context-basic.mdx";
+import CustomEventLogger from "./_shared/custom-event-logger/_custom-event-logger.mdx";
# Getting Started
+This page walks you through connecting your application to ABsmartly. By the end,
+you'll have the SDK installed, initialised, and a context ready to use for experiments.
+
+Once you've finished here, the [next page](./running-your-first-experiment) walks through
+a complete experiment: assigning variants, reading variables, and tracking goals. Together,
+these two pages give you everything you need to run your first test.
+
+:::info Prerequisites
+Before you start, make sure you have:
+- An ABsmartly account with your Web Console set up
+- Your **API key** (found in Settings > API Keys in the Web Console)
+- Your **application name** and **environment** configured in the Web Console
+:::
+
## Install the SDK
-## Import and Initialize the SDK
+## Import and Initialise the SDK
+
+
+
+
+Using a custom event logger
-
+The SDK fires events internally for things like exposures and goal tracking. By default
+these are handled automatically, but you can plug in a custom event logger if you need to:
-### Using a Custom Event Logger
+- **Debug during development** by printing events to the console
+- **Send events to your own analytics pipeline** alongside ABsmartly's collector
+- **Monitor SDK behaviour in production** for observability
+
+
## Create a New Context Request
-
+A context represents a single user's session with ABsmartly. It holds their variant
+assignments and queues up events to send to the collector. You'll need to create one
+before you can check treatments or track goals.
+
+
+
+## Next steps
+
+Your SDK is installed, initialised, and you have a context ready to go. Head over to
+[Running Your First Experiment](./running-your-first-experiment) to learn how to
+assign variants, use variables, and track goals.
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/_create-new-context-request.mdx b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/_create-new-context-request.mdx
deleted file mode 100644
index 22f82ab0..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/_create-new-context-request.mdx
+++ /dev/null
@@ -1,627 +0,0 @@
-import Tabs from "@theme/Tabs";
-import TabItem from "@theme/TabItem";
-import CodeBlock from "@theme/CodeBlock";
-import Image from "@theme/IdealImage";
-
-import JsRawPromises from "!!raw-loader!./js/usingRawPromises.js";
-import JsAsyncAwait from "!!raw-loader!./js/usingAsyncAwait.js";
-import JsPreFetchedData from "!!raw-loader!./js/withPreFetchedData.js";
-import JsRefreshWithFreshData from "!!raw-loader!./js/refreshWithFreshData.js";
-import JsRefreshWithRefreshMethod from "!!raw-loader!./js/refreshWithRefreshMethod.js";
-import JsHttpRequestTimeout from "!!raw-loader!./js/httpRequestTimeout.js";
-import JsHttpRequestCancellation from "!!raw-loader!./js/httpRequestCancellation.js";
-
-import PythonSync from "!!raw-loader!./python/sync.py";
-import PythonAsync from "!!raw-loader!./python/async.py";
-import PythonPreFetchedData from "!!raw-loader!./python/withPrefetchedData.py";
-import PythonRefreshWithFreshData from "!!raw-loader!./python/refreshWithFreshData.py";
-import PythonRefreshWithRefreshMethod from "!!raw-loader!./python/refreshWithRefreshMethod.py";
-import PythonExtraUnits from "!!raw-loader!./python/extraUnits.py"
-
-import ReactNewContext from "!!raw-loader!./react/newContext.js";
-import ReactWithABSmartly from "!!raw-loader!./react/withABSmartly.js";
-import ReactForTernaryOperator from "!!raw-loader!./react/forTernaryOperator.js";
-
-import SwiftNewContext from "!!raw-loader!./swift/newContext.swift";
-import SwiftPreFetchedData from "!!raw-loader!./swift/withPreFetchedData.swift";
-import SwiftSetExtraUnits from "!!raw-loader!./swift/settingExtraUnits.swift";
-import SwiftRefreshWithFreshData from "!!raw-loader!./swift/refreshWithFreshData.swift";
-import SwiftRefreshWithRefreshMethod from "!!raw-loader!./swift/refreshWithRefreshMethod.swift";
-
-import VuePreFetchedData from "!!raw-loader!./vue/initializeWithPrefetchedData.js";
-import VueRefreshWithFreshData from "!!raw-loader!./vue/RefreshWithFreshData.js";
-import VueRefreshWithRefreshMethod from "!!raw-loader!./vue/refreshWithRefreshMethod.js";
-
-import Vue3Sync from "!!raw-loader!./vue3/sync.js"
-import Vue3Prefetched from "!!raw-loader!./vue3/prefetched.js"
-import Vue3Refresh from "!!raw-loader!./vue3/refresh.js"
-import Vue3ManualRefresh from "!!raw-loader!./vue3/manualRefresh.js"
-
-import JavaSync from "!!raw-loader!./java/sync.java";
-import JavaAsync from "!!raw-loader!./java/async.java";
-import JavaPreFetched from "!!raw-loader!./java/preFetchedData.java";
-import JavaExtraUnits from "!!raw-loader!./java/extraUnits.java";
-import JavaRefreshWithFreshData from "!!raw-loader!./java/refreshWithFreshData.java";
-import JavaRefreshWithRefreshMethod from "!!raw-loader!./java/refreshWithRefreshMethod.java";
-
-import GoSync from "!!raw-loader!./go/sync.go";
-import GoAsync from "!!raw-loader!./go/async.go";
-import GoExtraUnits from "!!raw-loader!./go/extraUnits.go";
-import GoRefreshWithFreshData from "!!raw-loader!./go/refreshWithFreshData.go";
-import GoRefreshWithRefreshMethod from "!!raw-loader!./go/refreshWithRefreshMethod.go";
-
-import DotNetSync from "!!raw-loader!./dotnet/sync.cs";
-import DotNetAsync from "!!raw-loader!./dotnet/async.cs";
-import DotNetPrefetchedData from "!!raw-loader!./dotnet/prefetchedData.cs";
-import DotNetExtraUnits from "!!raw-loader!./dotnet/extraUnits.cs";
-import DotNetRefreshWithFreshData from "!!raw-loader!./dotnet/refreshWithFreshData.cs";
-import DotNetRefreshWithRefreshMethod from "!!raw-loader!./dotnet/refreshWithRefreshMethod.cs";
-
-import PHPSync from "!!raw-loader!./php/sync.php";
-import PHPRefresh from "!!raw-loader!./php/refresh.php";
-import PHPExtraUnits from "!!raw-loader!./php/extraUnits.php";
-import PHPPrefetchedData from "!!raw-loader!./php/prefetchedData.php";
-
-import RubyContext from "!!raw-loader!./ruby/createContext.rb";
-import RubyPreFetchedData from "!!raw-loader!./ruby/prefetchedData.rb";
-import RubyExtraUnits from "!!raw-loader!./ruby/extraUnits.rb";
-import RubyExtraUnitsAlt from "!!raw-loader!./ruby/extraUnitsAlt.rb";
-
-import FlutterSync from "!!raw-loader!./flutter/sync.dart"
-import FlutterAsync from "!!raw-loader!./flutter/async.dart"
-import FlutterPrefetchedData from "!!raw-loader!./flutter/withPrefetchedData.dart"
-import FlutterExtraUnits from "!!raw-loader!./flutter/extraUnits.dart"
-import FlutterRefresh from "!!raw-loader!./flutter/refreshWithFreshData.dart"
-import FlutterRefreshManual from "!!raw-loader!./flutter/refreshWithRefresh.dart"
-
-In order to start linking your experiments from the Web Console to your
-application, you will need to create a context. When you instantiate a context,
-you should pass all known characteristics of the current user. These
-characteristics are known as "units".
-
-You can use anything as a unit. For example, you can pass an internal user id or
-email address. You could also pass a `device_id` that you store in a first-
-party cookie or a mobile application `UUID`.
-
-:::info Keep In Mind
-The units that you pass must first be declared on your ABsmartly Web Console
-by going to `Settings -> Units`
-
-
-:::
-
-:::caution
-Experiments that are tracked by a unit which is not passed here will be turned off
-in this request and the control treatment will be shown instead.
-:::
-
-
-
-
-
-#### Create A New Context With Raw Promises
-
-{JsRawPromises}
-
-#### Create A New Context With Async/Await
-
-{JsAsyncAwait}
-
-#### Create A New Context With Pre-Fetched Data
-
-When doing full-stack experimentation with ABsmartly, we recommend only creating a
-context once on the server-side. Creating a context involves a round-trip
-to the ABsmartly event collector. We can avoid repeating the round-trip on
-the client-side by sending the server-side data embedded in the first document,
-for example, by rendering it on the template. We can then initialize the
-ABsmartly context on the client-side directly with it.
-
-{JsPreFetchedData}
-
-#### Refreshing the Context with Fresh Experiment Data
-
-For long-running single-page-applications (SPA), the context is usually
-created once when the application is first reached. However, any experiments
-being tracked in your production code, but started after the context was
-created, will not be triggered. To mitigate this, we can use the
-refreshInterval option when creating the context.
-
-{JsRefreshWithFreshData}
-
-Alternatively, the `refresh()` method can be called manually. The `refresh()`
-method pulls updated experiment data from the ABsmartly collector and will
-trigger recently started experiments when `treatment()` is called again.
-
-{JsRefreshWithRefreshMethod}
-
-#### HTTP request timeout
-
-It is possible to set a timeout per individual HTTP request, overriding the
-global timeout set for all request when instantiating the SDK object.
-
-Here is an example of setting a timeout only for the `createContext` request.
-
-{JsHttpRequestTimeout}
-
-#### HTTP Request cancellation
-
-Sometimes it is useful to cancel an inflight HTTP request, for example, when
-the user is navigating away. The ABsmartly SDK also supports a cancellation
-via an `AbortSignal`. An implementation of AbortController is provided for older
-platforms, but will use the native implementation where available.
-
-Here is an example of a cancellation scenario.
-
-{JsHttpRequestCancellation}
-
-
-
-
-
-#### Synchronously
-
-{PythonSync}
-
-#### Asynchronously
-
-{PythonAsync}
-
-#### With Prefetched Data
-
-{PythonPreFetchedData}
-
-#### Refreshing the context with fresh experiment data
-
-For long-running contexts, the context is usually created once when the application is first started.
-However, any experiments being tracked in your production code, but started after the context was created, will not be triggered.
-To mitigate this, we can use the `set_refresh_interval()` method on the context config.
-
-{PythonRefreshWithFreshData}
-
-Alternatively, the `refresh()` method can be called manually.
-The `refresh()` method pulls updated experiment data from the ABsmartly
-collector and will trigger recently started experiments when `get_treatment()`
-is called.
-
-{PythonRefreshWithRefreshMethod}
-
-#### Setting extra units
-
-You can add additional units to a context by calling the `set_unit()` or the `
-set_units()` method. This method may be used for example, when a user logs in
-to your application, and you want to use the new unit type to the context.
-Please note that **you cannot override an already set unit type** as that
-would be a change of identity, and will throw an exception. In this case, you
-must create a new context instead. The `SetUnit()` and `SetUnits()` methods
-can be called before the context is ready.
-
-{PythonExtraUnits}
-
-
-
-
-
-The SDK's Provider component automatically creates a new context for you. This
-can be accessed in one of two ways:
-
-#### Using React Hooks (Recommended)
-
-{ReactNewContext}
-
-#### Using `withABSmartly`
-
-If you are unable to use React Hooks in your application, you can get access
-to the `context` object by wrapping your component in the `withABSmartly` HOC
-before exporting it.
-
-{ReactWithABSmartly}
-
-#### Creating An Extra Context
-
-If you need to create an extra context, you can do so by accessing the SDK
-object which is provided by both of the above methods.
-
-```jsx
-const { context, sdk } = useABSmartly();
-
-// or using the withABSmartly HOC
-// const { context, sdk } = absmartly
-
-const secondContext = sdk?.createContext({
- units: {
- user_id: "example_user_id",
- anonymous_id: "example_anonymous_id",
- },
-});
-```
-
-#### Resetting the Context
-
-Sometimes, it may be necessary to reset your context with a new set of units.
-This can be done with the `resetContext` function:
-
-```jsx
-const { context, sdk, resetContext } = useABSmartly();
-
-// or using the withABSmartly HOC
-// const { context, sdk, resetContext } = absmartly
-
-resetContext({
- units: {
- anonymous_id: "example_anonymous_id",
- }
-})
-```
-This can be useful when, for example, a user logs out and logs back in again.
-You can then remove their `user_id` and replace it with an `anonymous_id` instead.
-
-
-
-
-
-**Creating a New Context**
-
-{SwiftNewContext}
-
-**Creating a New Context With Pre-Fetched Data**
-
-When doing full-stack experimentation with ABsmartly, we recommend creating a
-context only once on the server-side. Creating a context involves a round-trip
-to the ABsmartly event collector. We can avoid repeating the round-trip on
-the client-side by sending the server-side data embedded with other application
-data. We can then initialize the ABsmartly context directly with it.
-
-{SwiftPreFetchedData}
-
-**Setting Extra Units**
-
-You can add additional units to a context by calling the `setUnit()` or
-`setUnits()` methods. These methods may be used, for example, when a user logs in
-to your application and you want to use the new unit type in the context.
-
-:::caution Please Note
-You cannot override an already set unit type as that would be a change of
-identity, and would crash your application. In this case, you must create a new
-context instead. The `setUnit()` and `setUnits()` methods can be called before
-the context is ready.
-:::
-
-{SwiftSetExtraUnits}
-
-#### Refreshing the context with fresh experiment data
-
-For long-running contexts, the context is usually created once when the
-application is first reached. However, any experiments being tracked in your
-production code, but started after the context was created, will not be
-triggered. To mitigate this, we can use the `setRefreshInterval()` method on the
-context config.
-
-{SwiftRefreshWithFreshData}
-
-Alternatively, the `refresh()` method can be called manually.
-
-{SwiftRefreshWithRefreshMethod}
-
-
-
-
-
-**Initializing with pre-fetched Context data**
-
-When doing full-stack experimentation with ABsmartly, we recommend creating
-a context only once on the server-side. Creating a context involves a
-round-trip to the ABsmartly event collector. We can avoid repeating the
-round-trip on the client-side by sending the server-side data embedded in the
-first document, for example, by rendering it on the template. Then we can
-initialize the ABsmartly context on the client-side directly with it. The
-Vue2 SDK also supports this optimized usage.
-
-In this example, we assume the variable `prefectedContextData` contains the
-pre-fetched data previously injected.
-
-{VuePreFetchedData}
-
-#### Refreshing the context with fresh experiment data
-
-For long-running single-page-applications (SPA), the context is usually
-created once when the application is first reached. However, any experiments
-being tracked in your production code, but started after the context was
-created, will not be triggered. To mitigate this, we can use the
-refreshInterval option when initializing the SDK.
-
-{VueRefreshWithFreshData}
-
-Alternatively, the `refresh()` method can be called manually. The `refresh()`
-method pulls updated experiment data from the ABsmartly collector and will
-trigger recently started experiments when `treatment()` is called again.
-
-{VueRefreshWithRefreshMethod}
-
-
-
-
-
-**Synchronously**
-
-{Vue3Sync}
-
-**With Prefetched Data**
-
-{Vue3Prefetched}
-
-**Refreshing the Context with Fresh Experiment Data**
-
-For long-running contexts, the context is usually created once when the
-application is first started. However, any experiments being tracked in your
-production code, but started after the context was created, will not be
-triggered. To mitigate this, we can use the `refreshInterval` option on the
-context config.
-
-{Vue3Refresh}
-
-Alternatively, the `refresh()` method can be called manually. The `refresh()`
-method pulls updated experiment data from the ABsmartly collector and will
-trigger recently started experiments when `treatment()` is called again.
-
-{Vue3ManualRefresh}
-
-
-
-
-
-**Create A New Context Synchronously**
-
-{JavaSync}
-
-**Create A New Context Asynchronously**
-
-{JavaAsync}
-
-**Create A New Context With Pre-Fetched Data**
-
-Creating a context involves a round-trip to the ABsmartly event collector.
-We can avoid repeating the round-trip on the client-side by re-using data
-previously retrieved.
-
-{JavaPreFetched}
-
-**Setting Extra Units**
-
-You can add additional units to a context by calling the `setUnit()` or
-`setUnits()` methods. These methods may be used, for example, when a user logs in
-to your application and you want to use the new unit type in the context.
-
-:::caution Please Note
-You cannot override an already set unit type as that would be a change of
-identity and would throw an exception. In this case, you must create a new
-context instead. The `setUnit()` and `setUnits()` methods can be called before
-the context is ready.
-:::
-
-{JavaExtraUnits}
-
-#### Refreshing the context with fresh experiment data
-
-For long-running contexts, the context is usually created once when the
-application is first started. However, any experiments being tracked in your
-production code, but started after the context was created, will not be
-triggered. To mitigate this, we can use the `setRefreshInterval()` method on the
-context config.
-
-{JavaRefreshWithFreshData}
-
-Alternatively, the `refresh()` method can be called manually. The `refresh()`
-method pulls updated experiment data from the ABsmartly collector and will
-trigger recently started experiments when `getTreatment()` is called again.
-
-{JavaRefreshWithRefreshMethod}
-
-
-
-
-
-**Create A New Context Synchronously**
-
-{GoSync}
-
-**Create A New Context Asynchronously**
-
-{GoAsync}
-
-**Setting Extra Units**
-
-You can add additional units to a context by calling the `SetUnit()` or the
-`SetUnits()` method. This method may be used for example, when a user logs in to
-your application, and you want to use the new unit type to the context.
-
-:::caution Please Note
-You cannot override an already set unit type as that would be a
-change of identity, and will throw an exception. In this case, you must create
-a new context instead. The `SetUnit()` and `SetUnits()` methods can be called
-before the context is ready.
-:::
-
-{GoExtraUnits}
-
-#### Refreshing the context with fresh experiment data
-
-For long-running contexts, the context is usually created once when the
-application is first started. However, any experiments being tracked in your
-production code, but started after the context was created, will not be
-triggered. To mitigate this, we can use the `setRefreshInterval()` method on
-the context config.
-
-{GoRefreshWithFreshData}
-
-Alternatively, the `Refresh()` method can be called manually. The `Refresh()`
-method pulls updated experiment data from the ABsmartly collector and will
-trigger recently started experiments when `GetTreatment()` is called again.
-
-{GoRefreshWithRefreshMethod}
-
-
-
-
-
-**Create A New Context Synchronously**
-
-{DotNetSync}
-
-**Create A New Context Asynchronously**
-
-{DotNetAsync}
-
-**Creating A New Context With Pre-Fetched Data**
-
-Creating a context involves a round-trip to the ABsmartly event
-collector. We can avoid repeating the round-trip on the client-side by
-re-using previously retrieved data.
-
-{DotNetPrefetchedData}
-
-**Setting Extra Units**
-
-You can add additional units to a context by calling the `SetUnit()` or the
-`SetUnits()` method. This method may be used for example, when a user logs in to
-your application, and you want to add the new unit type to the context.
-
-:::caution Please Note
-You cannot override an already set unit type as that would be a
-change of identity, and will throw an exception. In this case, you must create
-a new context instead. The `SetUnit()` and `SetUnits()` methods can be called
-before the context is ready.
-:::
-
-{DotNetExtraUnits}
-
-**Refreshing The Context With Fresh Experiment Data**
-
-For long-running contexts, the context is usually created once when the
-application is first started. However, any experiments being tracked in your
-production code, but started after the context was created, will not be
-triggered. To mitigate this, we can use the `RefreshInterval()` method on
-the context config.
-
-{DotNetRefreshWithFreshData}
-
-Alternatively, the `Refresh()` method can be called manually. The `Refresh()`
-method pulls updated experiment data from the ABsmartly collector and will
-trigger recently started experiments when `GetTreatment()` is called again.
-
-{DotNetRefreshWithRefreshMethod}
-
-
-
-
-
-**Create A New Context Synchronously**
-
-{PHPSync}
-
-**Create A Context With Prefetched Data**
-
-{PHPPrefetchedData}
-
-**Refreshing the Context with Fresh Experiment Data**
-
-For long-running contexts, the context is usually created once when the
-application is first started. However, any experiments being tracked in your production code, but started after the context was created, will not be triggered.
-
-To mitigate this, we can use the `Context->refresh()` method on the `Context`.
-
-{PHPRefresh}
-
-The `Context->refresh()` method pulls updated experiment data from the ABsmartly collector and will trigger recently started experiments when `Context->getTreatment` is called again.
-
-**Setting Extra Units**
-
-You can add additional units to a context by calling the `Context->setUnit` or `Context->setUnits` methods. These methods may be used, for example, when a user logs in to your application, and you want to use the new unit type in the context.
-
-Please note, you cannot override an already set unit type as that would be a change of identity and would throw an exception. In this case, you must create a new context instead. The `Context->setUnit` and
-`Context->setUnits` methods can be called before the context is ready.
-
-{PHPExtraUnits}
-
-
-
-
-
-**Create A New Context**
-
-{RubyContext}
-
-**Create A Context With Prefetched Data**
-
-{RubyPreFetchedData}
-
-#### Refreshing the context with fresh experiment data
-
-For long-running contexts, the context is usually created once when the
-application is first started. However, any experiments being tracked in your
-production code, but started after the context was created, will not be
-triggered.
-
-Alternatively, the `refresh` method can be called manually. The `refresh` method
-pulls updated experiment data from the ABsmartly collector and will trigger
-recently started experiments when `treatment` is called again.
-
-**Setting Extra Units**
-
-You can add additional units to a context by calling the `set_unit()` or
-`set_units()` methods. These methods may be used, for example, when a user logs
-in to your application and you want to use the new unit type in the context.
-
-Please note, you cannot override an already set unit type as that would be a
-change of identity and would throw an exception. In this case, you must
-create a new context instead. The `set_unit()` and `set_units()` methods can be
-called before the context is ready.
-
-{RubyExtraUnits}
-
-or
-
-{RubyExtraUnitsAlt}
-
-
-
-
-
-#### Synchronously
-
-{FlutterSync}
-
-#### Asynchronously
-
-{FlutterAsync}
-
-#### With Prefetched Data
-
-{FlutterPrefetchedData}
-
-#### Refreshing the Context with Fresh Experiment Data
-
-For long-running contexts, the context is usually created once when the application is first started. However, any experiments being tracked in your production code, but started after the context was created, will not be triggered. To mitigate this, we can use the `setRefreshInterval()` method on the context config.
-
-{FlutterRefresh}
-
-Alternatively, the `refresh()` method can be called manually. The `refresh()` method pulls updated experiment data from the ABsmartly collector and will trigger recently started experiments when `getTreatment()` is called again.
-
-{FlutterRefreshManual}
-
-#### Setting Extra Units
-
-You can add additional units to a context by calling the `setUnit()` or
-`setUnits()` methods. These methods may be used, for example, when a user
-logs in to your application and you want to use the new unit type in the
-context.
-
-Please note, you cannot override an already set unit type as that would be
-a change of identity and would throw an exception. In this case, you must
-create a new context instead. The `setUnit()` and
-`setUnits()` methods can be called before the context is ready.
-
-{FlutterExtraUnits}
-
-
-
-
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/async.cs b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/async.cs
deleted file mode 100644
index 2c092999..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/async.cs
+++ /dev/null
@@ -1,4 +0,0 @@
- // define a new context request
- var config = new ContextConfig()
- .SetUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8");
- var context = _abSdk.CreateContext(config);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/extraUnits.cs b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/extraUnits.cs
deleted file mode 100644
index 7faf60cc..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/extraUnits.cs
+++ /dev/null
@@ -1,5 +0,0 @@
- context.SetUnit("db_user_id", "1000013");
-
- context.SetUnits(new Dictionary() {
- { "db_user_id", "1000013" }
- });
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/prefetchedData.cs b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/prefetchedData.cs
deleted file mode 100644
index f547bb04..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/prefetchedData.cs
+++ /dev/null
@@ -1,8 +0,0 @@
- var config = new ContextConfig()
- .SetUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8");
- var context = await _abSdk.CreateContextAsync(config);
-
- var anotherContextConfig = new ContextConfig()
- .SetUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d9"); // a unique id identifying the other user
-
- var anotherContext = _abSdk.CreateContextWith(anotherContextConfig, context.GetContextData());
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/refreshWithFreshData.cs b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/refreshWithFreshData.cs
deleted file mode 100644
index 49a45179..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/refreshWithFreshData.cs
+++ /dev/null
@@ -1,3 +0,0 @@
- var config = new ContextConfig()
- .SetUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8");
- config.RefreshInterval = TimeSpan.FromHours(4); // every 4 hours
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/refreshWithRefreshMethod.cs b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/refreshWithRefreshMethod.cs
deleted file mode 100644
index ac7424a9..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/refreshWithRefreshMethod.cs
+++ /dev/null
@@ -1,3 +0,0 @@
- context.Refresh();
- // or
- await context.RefreshAsync();
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/sync.cs b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/sync.cs
deleted file mode 100644
index 60e26e87..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/dotnet/sync.cs
+++ /dev/null
@@ -1,4 +0,0 @@
- // define a new context request
- var config = new ContextConfig()
- .SetUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8");
- var context = await _abSdk.CreateContextAsync(config);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/async.dart b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/async.dart
deleted file mode 100644
index 9aef84ee..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/async.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-createNewContext() async{
- final ContextConfig contextConfig = ContextConfig.create()
- .setUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8"); // a unique id identifying the user
-
- final Context? context = await sdk.createContext(contextConfig)
- .waitUntilReady();
-
- if(context != null){
- print("context ready");
- }
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/extraUnits.dart b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/extraUnits.dart
deleted file mode 100644
index f50a86eb..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/extraUnits.dart
+++ /dev/null
@@ -1,4 +0,0 @@
-context.setUnit("db_user_id", "1000013");
-context.setUnits({
- "db_user_id": "1000013"
- });
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/refreshWithFreshData.dart b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/refreshWithFreshData.dart
deleted file mode 100644
index 62cea051..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/refreshWithFreshData.dart
+++ /dev/null
@@ -1,3 +0,0 @@
- final ContextConfig contextConfig = ContextConfig.create()
- .setUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8")
- .setRefreshInterval(TimeUnit.HOURS.toMillis(4)); // every 4 hours
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/refreshWithRefresh.dart b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/refreshWithRefresh.dart
deleted file mode 100644
index d172dcaf..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/refreshWithRefresh.dart
+++ /dev/null
@@ -1 +0,0 @@
- context.refresh()
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/sync.dart b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/sync.dart
deleted file mode 100644
index 201b7c48..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/sync.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-createNewContext() async{
- final ContextConfig contextConfig = ContextConfig.create()
- .setUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8"); // a unique id identifying the user
-
- final Context? context = sdk.createContext(contextConfig)
- .waitUntilReady();
-
- if(context != null){
- print("context ready");
- }
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/withPrefetchedData.dart b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/withPrefetchedData.dart
deleted file mode 100644
index 06dd1884..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/flutter/withPrefetchedData.dart
+++ /dev/null
@@ -1,11 +0,0 @@
- final ContextConfig contextConfig = ContextConfig.create()
- .setUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8"); // a unique id identifying the user
-
- final Context context = sdk.createContext(contextConfig)
- .waitUntilReady();
-
- final ContextConfig anotherContextConfig = ContextConfig.create()
- .setUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8"); // a unique id identifying the other user
-
- final Context anotherContext = sdk.createContextWith(anotherContextConfig, context.getData());
- assert(anotherContext.isReady()); // no need to wait
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/async.go b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/async.go
deleted file mode 100644
index b33433e0..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/async.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// define a new context request
-var contextConfig = ContextConfig{Units_: map[string]string{
- "session_id": "bf06d8cb5d8137290c4abb64155584fbdb64d8",
- "user_id": "123456",
-}}
-
-var ctx = sdk.CreateContext(contextConfig)
-ctx.WaitUntilReadyAsync()
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/extraUnits.go b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/extraUnits.go
deleted file mode 100644
index e8415ccc..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/extraUnits.go
+++ /dev/null
@@ -1,5 +0,0 @@
-context.SetUnit("db_user_id", "1000013");
-
-context.SetUnits(map[string]string{
- "db_user_id": "1000013",
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/refreshWithFreshData.go b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/refreshWithFreshData.go
deleted file mode 100644
index 42d1128f..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/refreshWithFreshData.go
+++ /dev/null
@@ -1,4 +0,0 @@
-var contextConfig = ContextConfig{Units_: map[string]string{
- "session_id": "bf06d8cb5d8137290c4abb64155584fbdb64d8",
- "user_id": "123456",
-}, RefreshInteval_: 4 * Time.Hour}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/refreshWithRefreshMethod.go b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/refreshWithRefreshMethod.go
deleted file mode 100644
index 3a9c84be..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/refreshWithRefreshMethod.go
+++ /dev/null
@@ -1 +0,0 @@
-context.Refresh();
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/sync.go b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/sync.go
deleted file mode 100644
index e2e67661..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/go/sync.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// define a new context request
-var contextConfig = ContextConfig{Units_: map[string]string{
- "session_id": "bf06d8cb5d8137290c4abb64155584fbdb64d8",
- "user_id": "123456",
-}}
-
-var ctx = sdk.CreateContext(contextConfig)
-ctx.WaitUntilReady()
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/async.java b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/async.java
deleted file mode 100644
index 0672d9df..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/async.java
+++ /dev/null
@@ -1,7 +0,0 @@
-// define a new context request
-final ContextConfig contextConfig = ContextConfig.create()
- .setUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8"); // a unique id identifying the user
-
-final Context context = sdk.createContext(contextConfig)
- .waitUntilReadyAsync()
- .thenAccept(ctx -> System.out.printf("context ready!"));
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/extraUnits.java b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/extraUnits.java
deleted file mode 100644
index 042dbc2e..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/extraUnits.java
+++ /dev/null
@@ -1,5 +0,0 @@
-context.setUnit("db_user_id", "1000013");
-
-context.setUnits(Map.of(
- "db_user_id", "1000013"
-));
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/preFetchedData.java b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/preFetchedData.java
deleted file mode 100644
index 4ec72fb1..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/preFetchedData.java
+++ /dev/null
@@ -1,12 +0,0 @@
-final ContextConfig contextConfig = ContextConfig.create()
- .setUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8"); // a unique id identifying the user
-
-final Context context = sdk.createContext(contextConfig)
- .waitUntilReady();
-
-final ContextConfig anotherContextConfig = ContextConfig.create()
- .setUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8"); // a unique id identifying the other user
-
-final Context anotherContext = sdk.createContextWith(anotherContextConfig, context.getData());
-
-assert(anotherContext.isReady()); // no need to wait
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/refreshWithFreshData.java b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/refreshWithFreshData.java
deleted file mode 100644
index 559cff7c..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/refreshWithFreshData.java
+++ /dev/null
@@ -1,3 +0,0 @@
- final ContextConfig contextConfig = ContextConfig.create()
- .setUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8")
- .setRefreshInterval(TimeUnit.HOURS.toMillis(4)); // every 4 hours
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/refreshWithRefreshMethod.java b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/refreshWithRefreshMethod.java
deleted file mode 100644
index 04041621..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/refreshWithRefreshMethod.java
+++ /dev/null
@@ -1 +0,0 @@
- context.refresh();
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/sync.java b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/sync.java
deleted file mode 100644
index 25acc72a..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/java/sync.java
+++ /dev/null
@@ -1,6 +0,0 @@
-// define a new context request
-final ContextConfig contextConfig = ContextConfig.create()
- .setUnit("session_id", "5ebf06d8cb5d8137290c4abb64155584fbdb64d8"); // a unique id identifying the user
-
-final Context context = sdk.createContext(contextConfig)
- .waitUntilReady();
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/httpRequestCancellation.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/httpRequestCancellation.js
deleted file mode 100644
index ab771bf0..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/httpRequestCancellation.js
+++ /dev/null
@@ -1,17 +0,0 @@
-const controller = new absmartly.AbortController();
-const context = sdk.createContext(
- request,
- {
- refreshInterval: 5 * 60 * 1000,
- },
- {
- signal: controller.signal,
- }
-);
-
-// abort request if not ready after 1500ms
-const timeoutId = setTimeout(() => controller.abort(), 1500);
-
-await context.ready();
-
-clearTimeout(timeoutId);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/httpRequestTimeout.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/httpRequestTimeout.js
deleted file mode 100644
index 054460b5..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/httpRequestTimeout.js
+++ /dev/null
@@ -1,9 +0,0 @@
-const context = sdk.createContext(
- request,
- {
- refreshInterval: 5 * 60 * 1000,
- },
- {
- timeout: 1500,
- }
-);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/refreshWithFreshData.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/refreshWithFreshData.js
deleted file mode 100644
index f91cb1c3..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/refreshWithFreshData.js
+++ /dev/null
@@ -1,9 +0,0 @@
-const request = {
- units: {
- session_id: "5ebf06d8cb5d8137290c4abb64155584fbdb64d8",
- },
-};
-
-const context = sdk.createContext(request, {
- refreshInterval: 5 * 60 * 1000,
-});
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/refreshWithRefreshMethod.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/refreshWithRefreshMethod.js
deleted file mode 100644
index ac3175fe..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/refreshWithRefreshMethod.js
+++ /dev/null
@@ -1,7 +0,0 @@
-setTimeout(async () => {
- try {
- context.refresh();
- } catch (error) {
- console.error(error);
- }
-}, 5 * 60 * 1000);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/usingAsyncAwait.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/usingAsyncAwait.js
deleted file mode 100644
index a4204be9..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/usingAsyncAwait.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// define a new context request
-const request = {
- units: {
- userId: "123",
- session_id: "5ebf06d8cb5d8137290c4abb64155584fbdb64d8",
- email: "support@absmartly.com", // strings will be hashed
- deviceId: "345",
- },
-};
-
-const context = sdk.createContext(request);
-
-try {
- await context.ready();
- console.log("ABSmartly Context ready!");
-} catch (error) {
- console.log(error);
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/usingRawPromises.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/usingRawPromises.js
deleted file mode 100644
index aba9ae31..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/usingRawPromises.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// define a new context request
-const request = {
- units: {
- userId: "123",
- session_id: "5ebf06d8cb5d8137290c4abb64155584fbdb64d8",
- email: "support@absmartly.com", // strings will be hashed
- deviceId: "345",
- },
-};
-
-const context = sdk.createContext(request);
-
-context
- .ready()
- .then((response) => {
- console.log("ABSmartly Context ready!");
- })
- .catch((error) => {
- console.log(error);
- });
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/withPreFetchedData.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/withPreFetchedData.js
deleted file mode 100644
index fc5d2a95..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/js/withPreFetchedData.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// In your server-side code
-const serverSideParams = {
- units: {
- user_id: '123',
- anonymous_id: '456',
- session_id: '789',
- // ...
- },
-};
-
-const serverSideContext = sdk.createContext(serverSideParams);
-
-await serverSideContext.ready();
-
-const serverSideData = serverSideContext.data();
-
-// In your client-side code
-const clientSideOptions = {
- publishDelay: 100, // ms
-};
-
-const clientSideContext = sdk.createContextWith(serverSideParams, serverSideData, clientSideOptions);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/extraUnits.php b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/extraUnits.php
deleted file mode 100644
index a5165d12..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/extraUnits.php
+++ /dev/null
@@ -1 +0,0 @@
-$context->setUnit('user_id', 143432);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/prefetchedData.php b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/prefetchedData.php
deleted file mode 100644
index f518598f..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/prefetchedData.php
+++ /dev/null
@@ -1,9 +0,0 @@
-$contextConfig = new ContextConfig();
-$contextConfig->setUnit('session_id', 'session_id5ebf06d8cb5d8137290c4abb64155584fbdb64d8'); // a unique id identifying the user
-
-$context = $sdk->createContext($contextConfig);
-
-$anotherContextConfig = new ContextConfig();
-$anotherContextConfig->setUnit('session_id', 'session_id5ebf06d8cb5d8137290c4abb64155584fbdb64d8'); // a unique id identifying the user
-
-$anotherContext = $sdk->createContextWithData($anotherContextConfig, $context->getContextData());
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/refresh.php b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/refresh.php
deleted file mode 100644
index ee09c96d..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/refresh.php
+++ /dev/null
@@ -1 +0,0 @@
-$context->refresh();
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/sync.php b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/sync.php
deleted file mode 100644
index 0211e486..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/php/sync.php
+++ /dev/null
@@ -1,4 +0,0 @@
-$contextConfig = new ContextConfig();
-$contextConfig->setUnit('session_id', 'session_id5ebf06d8cb5d8137290c4abb64155584fbdb64d8'); // a unique id identifying the user
-
-$context = $sdk->createContext($contextConfig);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/async.py b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/async.py
deleted file mode 100644
index 026e5080..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/async.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# define a new context request
- context_config = ContextConfig()
- context_config.publish_delay = 10
- context_config.refresh_interval = 5
-
- context_config = ContextConfig()
- ctx = sdk.create_context(context_config)
- ctx.wait_until_ready_async()
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/extraUnits.py b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/extraUnits.py
deleted file mode 100644
index 7b14b7c2..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/extraUnits.py
+++ /dev/null
@@ -1,5 +0,0 @@
- context.set_unit("db_user_id", "1000013")
-
- context.set_units({
- "db_user_id": "1000013"
- })
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/refreshWithFreshData.py b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/refreshWithFreshData.py
deleted file mode 100644
index 548f6c91..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/refreshWithFreshData.py
+++ /dev/null
@@ -1,2 +0,0 @@
- default_client_config = DefaultHTTPClientConfig()
- default_client_config.refresh_interval = 5
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/refreshWithRefreshMethod.py b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/refreshWithRefreshMethod.py
deleted file mode 100644
index d172dcaf..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/refreshWithRefreshMethod.py
+++ /dev/null
@@ -1 +0,0 @@
- context.refresh()
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/sync.py b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/sync.py
deleted file mode 100644
index d778d302..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/sync.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# define a new context request
- context_config = ContextConfig()
- context_config.publish_delay = 10
- context_config.refresh_interval = 5
-
- context_config = ContextConfig()
- ctx = sdk.create_context(context_config)
- ctx.wait_until_ready()
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/withPrefetchedData.py b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/withPrefetchedData.py
deleted file mode 100644
index 90e93a8a..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/python/withPrefetchedData.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# define a new context request
- context_config = ContextConfig()
- context_config.publish_delay = 10
- context_config.refresh_interval = 5
- context_config.units = {"session_id": "bf06d8cb5d8137290c4abb64155584fbdb64d8",
- "user_id": "12345"}
-
- context_config = ContextConfig()
- ctx = sdk.create_context(context_config)
- ctx.wait_until_ready_async()
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/forTernaryOperator.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/forTernaryOperator.js
deleted file mode 100644
index 5d03e309..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/forTernaryOperator.js
+++ /dev/null
@@ -1,43 +0,0 @@
-import React, { useEffect } from "react";
-import { useABSmartly } from "react-sdk";
-
-function App() {
- // Get the SDK object using the useABSmartly hook
- const sdk = useABSmartly();
-
- // Define a new context request
- const request = {
- units: {
- // All data will be hashed
- userId: "123",
- session_id: "5ebf06d8cb5d8137290c4abb64155584fbdb64d8",
- email: "support@absmartly.com",
- deviceId: "345",
- },
- };
-
- // Create a memo-ised context
- const context = sdk?.createContext(request);
-
- // Check if the context is ready in a useEffect hook
- useEffect(() => {
- context
- .ready()
- .then(() => {
- console.log("ABSmartly Context ready!");
- })
- .catch((error) => {
- console.error(error);
- });
- }, [context]);
-
- return (
-
- {
- // ...App content
- }
-
- );
-}
-
-export default App;
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/newContext.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/newContext.js
deleted file mode 100644
index 1c38a951..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/newContext.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import React, { useEffect } from "react";
-import { useABSmartly } from "react-sdk";
-
-function App() {
- // Get the context object using the useABSmartly hook
- const { context } = useABSmartly();
-
- return (
-
- {
- // ...App content
- }
-
- );
-}
-
-export default App;
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/withABSmartly.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/withABSmartly.js
deleted file mode 100644
index ad3d65fa..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/react/withABSmartly.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import React from "react";
-import { withABSmartly } from "react-sdk";
-
-// The absmartly object comes from the withABSmartly HOC
-function App({ absmartly }) {
- const { context } = absmartly;
-
- return (
-
- {
- // ...App content
- }
-
- );
-}
-
-// Export the component wrapped in the withABSmartly HOC
-export default withABSmartly(App);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/createContext.rb b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/createContext.rb
deleted file mode 100644
index d535f574..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/createContext.rb
+++ /dev/null
@@ -1 +0,0 @@
-context_config = Absmartly.create_context_config
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/extraUnits.rb b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/extraUnits.rb
deleted file mode 100644
index 1056c022..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/extraUnits.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-context_config.set_unit('session_id', 'bf06d8cb5d8137290c4abb64155584fbdb64d8')
-context_config.set_unit('user_id', '123456')
-context = Absmartly.create_context(context_config)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/extraUnitsAlt.rb b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/extraUnitsAlt.rb
deleted file mode 100644
index 99effec0..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/extraUnitsAlt.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-context_config.set_units(
- session_id: 'bf06d8cb5d8137290c4abb64155584fbdb64d8',
- user_id: '123456'
-)
-context = Absmartly.create_context(context_config)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/prefetchedData.rb b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/prefetchedData.rb
deleted file mode 100644
index 6d49a474..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/ruby/prefetchedData.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-client_config = ClientConfig.new(
- endpoint: 'https://your-company.absmartly.io/v1',
- api_key: 'YOUR-API-KEY',
- application: 'website',
- environment: 'development')
-
-sdk_config = ABSmartlyConfig.create
-sdk_config.client = Client.create(client_config)
-
-sdk = Absmartly.create(sdk_config)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/newContext.swift b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/newContext.swift
deleted file mode 100644
index 66a79142..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/newContext.swift
+++ /dev/null
@@ -1,7 +0,0 @@
-let contextConfig: ContextConfig = ContextConfig()
-contextConfig.setUnit(unitType: "device_id", uid: UIDevice.current.identifierForVendor!.uuidString))
-
-let context = sdk.createContext(config: contextConfig)
-context.waitUntilReady().done { context in
- print("context ready")
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/refreshWithFreshData.swift b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/refreshWithFreshData.swift
deleted file mode 100644
index 46e0ff01..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/refreshWithFreshData.swift
+++ /dev/null
@@ -1,3 +0,0 @@
-let contextConfig: ContextConfig = ContextConfig()
-contextConfig.setUnit(unitType: "device_id", uid: UIDevice.current.identifierForVendor!.uuidString)
-contextConfig.refreshInterval = 4 * 3600; // every 4 hours
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/refreshWithRefreshMethod.swift b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/refreshWithRefreshMethod.swift
deleted file mode 100644
index d5ed2472..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/refreshWithRefreshMethod.swift
+++ /dev/null
@@ -1,3 +0,0 @@
-context.refresh().done {
- print("refreshed")
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/settingExtraUnits.swift b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/settingExtraUnits.swift
deleted file mode 100644
index 70391191..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/settingExtraUnits.swift
+++ /dev/null
@@ -1,4 +0,0 @@
-context.setUnit(unitType: "db_user_id", uid: "1000013");
-context.setUnits([
- "db_user_id": "1000013"
-]);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/withPreFetchedData.swift b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/withPreFetchedData.swift
deleted file mode 100644
index e6a04c76..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/swift/withPreFetchedData.swift
+++ /dev/null
@@ -1,4 +0,0 @@
-let contextConfig: ContextConfig = ContextConfig()
-contextConfig.setUnit(unitType: "device_id", uid: UIDevice.current.identifierForVendor!.uuidString)
-
-let context = sdk.createContextWithData(config: anotherContextConfig, contextData: contextData)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/RefreshWithFreshData.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/RefreshWithFreshData.js
deleted file mode 100644
index 9fa28b90..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/RefreshWithFreshData.js
+++ /dev/null
@@ -1,8 +0,0 @@
-Vue.use(absmartly.ABSmartlyVue, {
- /* ... */
- context: {
- units: { session_id: "5ebf06d8cb5d8137290c4abb64155584fbdb64d8" },
- refreshInterval: 5 * 60 * 1000,
- },
- /* ... */
-});
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/initializeWithPrefetchedData.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/initializeWithPrefetchedData.js
deleted file mode 100644
index bf2f306e..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/initializeWithPrefetchedData.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Somewhere in your application initialization code, before mounting your Vue application
-Vue.use(absmartly.ABSmartlyVue, {
- sdkOptions: {
- endpoint: "https://sandbox-api.absmartly.com/v1",
- apiKey: ABSMARTLY_API_KEY,
- environment: "production",
- application: "website",
- },
- context: {
- units: {
- session_id: "5ebf06d8cb5d8137290c4abb64155584fbdb64d8",
- },
- },
- attributes: {
- user_agent: navigator.userAgent,
- },
- data: prefetchedContext, // assuming prefectedContext has been injected
-});
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/refreshWithRefreshMethod.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/refreshWithRefreshMethod.js
deleted file mode 100644
index 0e333253..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue/refreshWithRefreshMethod.js
+++ /dev/null
@@ -1,7 +0,0 @@
-setTimeout(async () => {
- try {
- this.$absmartly.refresh();
- } catch (error) {
- console.error(error);
- }
-}, 5 * 60 * 1000);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/manualRefresh.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/manualRefresh.js
deleted file mode 100644
index 0e333253..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/manualRefresh.js
+++ /dev/null
@@ -1,7 +0,0 @@
-setTimeout(async () => {
- try {
- this.$absmartly.refresh();
- } catch (error) {
- console.error(error);
- }
-}, 5 * 60 * 1000);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/prefetched.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/prefetched.js
deleted file mode 100644
index 16e9d0d1..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/prefetched.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// somewhere in your application initialization code, before mounting your Vue application
-app.use(absmartly.ABSmartlyVue, {
- sdkOptions: {
- endpoint: 'https://sandbox-api.absmartly.com/v1',
- apiKey: ABSMARTLY_API_KEY,
- environment: "production",
- application: "website",
- },
- context: {
- units: {
- session_id: '5ebf06d8cb5d8137290c4abb64155584fbdb64d8',
- },
- },
- attributes: {
- user_agent: navigator.userAgent
- },
- data: prefetchedContext, // assuming prefectedContext has been inject
-});
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/refresh.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/refresh.js
deleted file mode 100644
index a1c7be21..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/refresh.js
+++ /dev/null
@@ -1,8 +0,0 @@
-app.use(absmartly.ABSmartlyVue, {
- /* ... */
- context: {
- units: { session_id: "5ebf06d8cb5d8137290c4abb64155584fbdb64d8" },
- refreshInterval: 5 * 60 * 1000,
- },
- /* ... */
-});
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/sync.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/sync.js
deleted file mode 100644
index 3208656d..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/create-new-context-request/vue3/sync.js
+++ /dev/null
@@ -1,16 +0,0 @@
-app.use(absmartly.ABSmartlyVue, {
- sdkOptions: {
- endpoint: 'https://sandbox-api.absmartly.com/v1',
- apiKey: ABSMARTLY_API_KEY,
- environment: "production",
- application: "website",
- },
- context: {
- units: {
- session_id: '5ebf06d8cb5d8137290c4abb64155584fbdb64d8',
- },
- },
- attributes: {
- user_agent: navigator.userAgent
- },
-});
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/_custom-event-logger.mdx b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/_custom-event-logger.mdx
deleted file mode 100644
index 92724748..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/custom-event-logger/_custom-event-logger.mdx
+++ /dev/null
@@ -1,280 +0,0 @@
-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 FlutterCustomEventLogger from "!!raw-loader!./flutter/customEventLogger.dart";
-import FlutterUsage from "!!raw-loader!./flutter/usage.dart";
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all
-contexts. In addition, an event logger can be specified when creating a
-particular context, in the `createContext` call options. The example below
-illustrates this with the implementation of the default event logger, used if
-none is specified.
-
-{JsCustomEventLogger}
-
-The data parameter depends on the type of event. Currently, the SDK logs the
-following events:
-
-| eventName | when | data |
-| ------------ | ------------------------------------------------------- | -------------------------------------------- |
-| `"error"` | `Context` receives an error | error object thrown |
-| `"ready"` | `Context` turns ready | data used to initialize the context |
-| `"refresh"` | `Context.refresh()` method succeeds | data used to refresh the context |
-| `"publish"` | `Context.publish()` method succeeds | data sent to the ABsmartly event collector |
-| `"exposure"` | `Context.treatment()` method succeeds on first exposure | exposure data enqueued for publishing |
-| `"goal"` | `Context.track()` method succeeds | goal data enqueued for publishing |
-| `"finalize"` | `Context.finalize()` method succeeds the first time | undefined |
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all
-contexts. In addition, an event logger can be specified when creating a
-particular context, in the `ContextConfig`.
-
-{PythonCustomEventLogger}
-
-The data parameter depends on the type of event.
-Currently, the SDK logs the following events:
-
-| event | when | data |
-| :--------: | ---------------------------------------------------------- | ------------------------------------------------------ |
-| `Error` | `Context` receives an error | `Throwable` object |
-| `Ready` | `Context` turns ready | `ContextData` used to initialize the context |
-| `Refresh` | `Context.refresh()` method succeeds | `ContextData` used to refresh the context |
-| `Publish` | `Context.publish()` method succeeds | `PublishEvent` sent to the ABsmartly event collector |
-| `Exposure` | `Context.getTreatment()` method succeeds on first exposure | `Exposure` enqueued for publishing |
-| `Goal` | `Context.track()` method succeeds | `GoalAchievement` enqueued for publishing |
-| `Close` | `Context.close()` method succeeds the first time | `null` |
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all
-contexts. In addition, an event logger can be specified when creating a
-particular context, in the `createContext` call options. The example below
-illustrates this with the implementation of the default event logger, used if
-none is specified.
-
-{ReactCustomEventLogger}
-
-The data parameter depends on the type of event. Currently, the SDK logs the
-following events:
-
-| eventName | when | data |
-| ------------ | ------------------------------------------------------- | -------------------------------------------- |
-| `"error"` | `Context` receives an error | error object thrown |
-| `"ready"` | `Context` turns ready | data used to initialize the context |
-| `"refresh"` | `Context.refresh()` method succeeds | data used to refresh the context |
-| `"publish"` | `Context.publish()` method succeeds | data sent to the ABsmartly event collector |
-| `"exposure"` | `Context.treatment()` method succeeds on first exposure | exposure data enqueued for publishing |
-| `"goal"` | `Context.track()` method succeeds | goal data enqueued for publishing |
-| `"finalize"` | `Context.finalize()` method succeeds the first time | undefined |
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all
-contexts. In addition, an event logger can be specified when creating a
-particular context, in the `ContextConfig`.
-
-{SwiftCustomEventLogger}
-
-The event data depends on the type of event. Currently, the SDK logs the following events:
-
-| event | when | data |
-| ---------- | ---------------------------------------------------------- | ------------------------------------------------------ |
-| `error` | `Context` receives an error | `Error` object |
-| `ready` | `Context` turns ready | `ContextData` used to initialize the context |
-| `refresh` | `Context.refresh()` method succeeds | `ContextData` used to refresh the context |
-| `publish` | `Context.publish()` method succeeds | `PublishEvent` sent to the ABsmartly event collector |
-| `exposure` | `Context.getTreatment()` method succeeds on first exposure | `Exposure` enqueued for publishing |
-| `goal` | `Context.track()` method succeeds | `GoalAchievement` enqueued for publishing |
-| `close` | `Context.close()` method succeeds the first time | `nil` |
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all
-contexts. The example below illustrates this with the implementation of the
-default event logger, used if none is specified.
-
-{VueCustomEventLogger}
-
-The event data depends on the type of event. Currently, the SDK logs the following events:
-
-| eventName | when | data |
-| ------------ | ------------------------------------------------------- | -------------------------------------------- |
-| `"error"` | `Context` receives an error | error object thrown |
-| `"ready"` | `Context` turns ready | data used to initialize the context |
-| `"refresh"` | `Context.refresh()` method succeeds | data used to refresh the context |
-| `"publish"` | `Context.publish()` method succeeds | data sent to the ABsmartly event collector |
-| `"exposure"` | `Context.treatment()` method succeeds on first exposure | exposure data enqueued for publishing |
-| `"goal"` | `Context.track()` method succeeds | goal data enqueued for publishing |
-| `"finalize"` | `Context.finalize()` method succeeds the first time | undefined |
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all
-contexts. The example below illustrates this with the implementation of the
-default event logger, used if none is specified.
-
-{VueCustomEventLogger}
-
-The event data depends on the type of event. Currently, the SDK logs the following events:
-
-| eventName | when | data |
-| ------------ | ------------------------------------------------------- | -------------------------------------------- |
-| `"error"` | `Context` receives an error | error object thrown |
-| `"ready"` | `Context` turns ready | data used to initialize the context |
-| `"refresh"` | `Context.refresh()` method succeeds | data used to refresh the context |
-| `"publish"` | `Context.publish()` method succeeds | data sent to the ABsmartly event collector |
-| `"exposure"` | `Context.treatment()` method succeeds on first exposure | exposure data enqueued for publishing |
-| `"goal"` | `Context.track()` method succeeds | goal data enqueued for publishing |
-| `"finalize"` | `Context.finalize()` method succeeds the first time | undefined |
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all
-contexts. In addition, an event logger can be specified when creating a
-particular context, in the `ContextConfig`.
-
-{JavaCustomEventLogger}
-
-The data parameter depends on the type of event. Currently, the SDK logs the
-following events:
-
-| event | when | data |
-| ---------- | ---------------------------------------------------------- | ------------------------------------------------------ |
-| `Error` | `Context` receives an error | `Throwable` object |
-| `Ready` | `Context` turns ready | `ContextData` used to initialize the context |
-| `Refresh` | `Context.refresh()` method succeeds | `ContextData` used to refresh the context |
-| `Publish` | `Context.publish()` method succeeds | `PublishEvent` sent to the ABsmartly event collector |
-| `Exposure` | `Context.getTreatment()` method succeeds on first exposure | `Exposure` enqueued for publishing |
-| `Goal` | `Context.track()` method succeeds | `GoalAchievement` enqueued for publishing |
-| `Close` | `Context.close()` method succeeds the first time | `null` |
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all
-contexts. In addition, an event logger can be specified when creating a
-particular context, in the `ContextConfig`.
-
-{GoCustomEventLogger}
-
-The data parameter depends on the type of event. Currently, the SDK logs the
-following events:
-
-| event | when | data |
-| ---------- | ---------------------------------------------------------- | ------------------------------------------------------ |
-| `Error` | `Context` receives an error | `Throwable` object |
-| `Ready` | `Context` turns ready | `ContextData` used to initialize the context |
-| `Refresh` | `Context.refresh()` method succeeds | `ContextData` used to refresh the context |
-| `Publish` | `Context.publish()` method succeeds | `PublishEvent` sent to the ABsmartly event collector |
-| `Exposure` | `Context.getTreatment()` method succeeds on first exposure | `Exposure` enqueued for publishing |
-| `Goal` | `Context.track()` method succeeds | `GoalAchievement` enqueued for publishing |
-| `Close` | `Context.close()` method succeeds the first time | `null` |
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all
-contexts or, an event logger can be specified when creating a
-particular context in the `ContextConfig`.
-
-{DotNetCustomEventLogger}
-
-{DotNetCustomEventLoggerWithInjection}
-
-The data parameter depends on the type of event. Currently, the SDK logs
-the following events:
-
-| event | when | data |
-| ---------- | ------------------------------------------------------------- | ------------------------------------------------------ |
-| `Error` | `Context` receives an error | `Exception` object |
-| `Ready` | `Context` turns ready | `ContextData` used to initialize the context |
-| `Refresh` | `Context.Refresh()` method succeeds | `ContextData` used to refresh the context |
-| `Publish` | `Context.Publish()` or Context.PublishAsync() method succeeds | `PublishEvent` sent to the ABsmartly event collector |
-| `Exposure` | `Context.GetTreatment()` method succeeds on first exposure | `Exposure` enqueued for publishing |
-| `Goal` | `Context.Track()` method succeeds | `GoalAchievement` enqueued for publishing |
-| `Close` | `Context` disposal succeeds | `null` |
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all contexts. In addition, an event logger can be specified when creating a particular context in the `ContextConfig`.
-
-{PHPCustomEventLogger}
-
-Alternately, it is possible to implement `\ABSmartly\SDK\Context\ContextEventLogger` interface with `handleEvent()` method that receives the `Context` object itself, along with a `ContextEventLoggerEvent` object as shown below:
-
-{PHPHandleEvent}
-
-The data parameter depends on the type of event. Currently, the SDK logs the following events:
-
-| eventName | when | data |
-| ------------ | ----------------------------------------------------------- | ----------------------------------------------------------- |
-| `"Error"` | `Context` receives an error | `Exception` object thrown |
-| `"Ready"` | `Context` turns ready | `ContextData` object used to initialize the context |
-| `"Refresh"` | `Context->refresh()` method succeeds | `ContextData` used to refresh the context |
-| `"Publish"` | `Context->publish()` method succeeds | `PublishEvent` data sent to the ABsmartly event collector |
-| `"Exposure"` | `Context->getTreatment()` method succeeds on first exposure | `Exposure` data enqueued for publishing |
-| `"Goal"` | `Context->Track()` method succeeds | `GoalAchivement` goal data enqueued for publishing |
-| `"Close"` | `Context->lose()` method succeeds the first time | `null` |
-
-
-
-
-
-The ABsmartly SDK can be instantiated with an event logger used for all contexts. In addition, an event logger can be specified when creating a particular context in the `contextConfig`.
-
-{FlutterCustomEventLogger}
-
-{FlutterUsage}
-
-The data parameter depends on the type of event. Currently, the SDK logs the following events:
-
-| eventName | when | data |
-| ------------ | ------------------------------------------------------- | -------------------------------------------- |
-| `"error"` | `Context` receives an error | error object thrown |
-| `"ready"` | `Context` turns ready | data used to initialize the context |
-| `"refresh"` | `Context.refresh()` method succeeds | data used to refresh the context |
-| `"publish"` | `Context.publish()` method succeeds | data sent to the ABsmartly event collector |
-| `"exposure"` | `Context.treatment()` method succeeds on first exposure | exposure data enqueued for publishing |
-| `"goal"` | `Context.track()` method succeeds | goal data enqueued for publishing |
-| `"finalize"` | `Context.finalize()` method succeeds the first time | undefined |
-
-
-
-
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/_import-and-initialize.mdx b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/_import-and-initialize.mdx
deleted file mode 100644
index defb8f01..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/_import-and-initialize.mdx
+++ /dev/null
@@ -1,385 +0,0 @@
-import Tabs from "@theme/Tabs";
-import TabItem from "@theme/TabItem";
-import CodeBlock from "@theme/CodeBlock";
-
-import JsImport from "!!raw-loader!./js/import.js";
-
-import PythonImport from "!!raw-loader!./python/import.py";
-
-import ReactImport from "!!raw-loader!./react/import.jsx";
-
-import SwiftImport from "!!raw-loader!./swift/import.swift";
-
-import VueImport from "!!raw-loader!./vue/import.js";
-
-import Vue3Import from "!!raw-loader!./vue3/import.js";
-
-import JavaImport from "!!raw-loader!./java/import.java";
-import JavaImportAndroid6 from "!!raw-loader!./java/importForAndroid6.java";
-
-import GoImport from "!!raw-loader!./go/initialize.go";
-
-import DotNetStartupCode from "!!raw-loader!./dotnet/startupCode.cs";
-import DotNetSDKInjection from "!!raw-loader!./dotnet/sdkInjection.cs";
-import DotNetManualSDKInstance from "!!raw-loader!./dotnet/manualSDKInstance.cs";
-
-import PHPImportAndInitialize from "!!raw-loader!./php/importAndInitialize.php";
-import PHPParamsInOrder from "!!raw-loader!./php/paramsInOrder.php";
-import PHPGranularChoice from "!!raw-loader!./php/granularChoice.php";
-
-import RubyImport from "!!raw-loader!./ruby/import.rb";
-
-import FlutterImport from "!!raw-loader!./flutter/import.dart";
-
-Once the SDK is installed, it can be initialized in your project.
-
-:::info
-The following examples assume that an [Api Key with SDK permissions](/docs/web-console-docs/configuration/settings#api-keys),
-an [Application](/docs/web-console-docs/Configuration/Applications), and an
-[Environment](/docs/web-console-docs/configuration/settings#environments) have been created in the ABsmartly Web Console.
-:::
-
-
-
-
-
-{JsImport}
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :---------- | :----------------------------------- | :-------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| retries | `number` | ❌ | `5` | The number of retries before the SDK stops trying to connect. |
-| timeout | `number` | ❌ | `3000` | An amount of time, in milliseconds, before the SDK will stop trying to connect. |
-| eventLogger | `(context, eventName, data) => void` | ❌ | See [Using a Custom Event Logger](#using-a-custom-event-logger) below | A callback function which runs after SDK events. |
-
-
-
-
-
-{PythonImport}
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :------------------- | :-------------------------------------------- | :-------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| max_retries | `number` | ❌ | `5` | The number of retries before the SDK stops trying to connect. |
-| connection_timeout | `number` | ❌ | `3` | An amount of time, in seconds, before the SDK will stop trying to connect. |
-| context_event_logger | `(self, event_type: EventType, data: object)` | ❌ | See [Using a Custom Event Logger](#using-a-custom-event-logger) below | A callback function which runs after SDK events. |
-
-
-
-
-
-
- {ReactImport}
-
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :---------- | :----------------------------------- | :-------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| retries | `number` | ❌ | `5` | The number of retries before the SDK stops trying to connect. |
-| timeout | `number` | ❌ | `3000` | An amount of time, in milliseconds, before the SDK will stop trying to connect. |
-| eventLogger | `(context, eventName, data) => void` | ❌ | See [Using a Custom Event Logger](#using-a-custom-event-logger) below | A callback function which runs after SDK events. |
-
-**Initializing the SDK with a Pre-Fetched Context**
-
-If you have used the Javascript SDK to create a context, you can pass it
-directly into the Provider component, like so:
-
-```jsx
-ReactDOM.render(
-
-
- ,
- document.getElementById("root")
-);
-```
-
-:::info NextJS
-If you are using NextJS and want to fetch the context on the server side,
-you can leverage `getServerSideProps` and add the ABsmartly Provider on a
-per-page basis. For example:
-
-```tsx title="pages/index.tsx"
-export const getServerSideProps: GetServerSideProps = async () => {
- const sdkOptions = {
- endpoint: "https://.absmartly.io/v1",
- apiKey: "",
- application: "web",
- environment: process.env.NODE_ENV
- }
-
- const serverSDK = new absmartly.SDK(sdkOptions)
-
- const contextOptions = {
- units: {
- user_id: "123",
- anonymous_id: "456",
- device_id: "789",
- }
- }
-
- const context = serverSDK.createContext(contextOptions);
-
- await context.ready();
-
- return {
- props: {
- contextData: context.data(), contextOptions, sdkOptions
- },
- };
-}
-
-export default function Home({ contextData, contextOptions, sdkOptions }) {
- const clientSDK = new absmartly.SDK(sdkOptions)
-
- const clientContext = clientSDK.createContextWith(contextOptions, contextData);
-
- return (
-
- {/* Your page content */}
-
- )
-}
-```
-:::
-
-
-
-
-
-{SwiftImport}
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :---------- | :----------------------------------- | :-------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| retries | `number` | ❌ | `5` | The number of retries before the SDK stops trying to connect. |
-| timeout | `number` | ❌ | `3000` | An amount of time, in milliseconds, before the SDK will stop trying to connect. |
-| eventLogger | `(context, eventName, data) => void` | ❌ | See [Using a Custom Event Logger](#using-a-custom-event-logger) below | A callback function which runs after SDK events. |
-
-
-
-
-
-{VueImport}
-
-This makes the `$absmartly` extension available in every Vue instance.
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :---------- | :----------------------------------- | :-------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| retries | `number` | ❌ | `5` | The number of retries before the SDK stops trying to connect. |
-| timeout | `number` | ❌ | `3000` | An amount of time, in milliseconds, before the SDK will stop trying to connect. |
-| eventLogger | `(context, eventName, data) => void` | ❌ | See [Using a Custom Event Logger](#using-a-custom-event-logger) below | A callback function which runs after SDK events. |
-
-
-
-
-
-{Vue3Import}
-
-This makes the `$absmartly` extension available in every Vue instance.
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :---------- | :----------------------------------- | :-------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| retries | `number` | ❌ | `5` | The number of retries before the SDK stops trying to connect. |
-| timeout | `number` | ❌ | `3000` | An amount of time, in milliseconds, before the SDK will stop trying to connect. |
-| eventLogger | `(context, eventName, data) => void` | ❌ | See [Using a Custom Event Logger](#using-a-custom-event-logger) below | A callback function which runs after SDK events. |
-
-
-
-
-
-{JavaImport}
-
-:::caution 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:
-
-{JavaImportAndroid6}
-:::
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :---------- | :----------------------------------- | :-------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| retries | `number` | ❌ | `5` | The number of retries before the SDK stops trying to connect. |
-| timeout | `number` | ❌ | `3000` | An amount of time, in milliseconds, before the SDK will stop trying to connect. |
-| eventLogger | `(context, eventName, data) => void` | ❌ | See [Using a Custom Event Logger](#using-a-custom-event-logger) below | A callback function which runs after SDK events. |
-
-
-
-
-
-{GoImport}
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :---------- | :----------------------------------- | :-------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| retries | `number` | ❌ | `5` | The number of retries before the SDK stops trying to connect. |
-| timeout | `number` | ❌ | `3000` | An amount of time, in milliseconds, before the SDK will stop trying to connect. |
-| eventLogger | `(context, eventName, data) => void` | ❌ | See [Using a Custom Event Logger](#using-a-custom-event-logger) below | A callback function which runs after SDK events. |
-
-
-
-
-
-If your project uses .NET dependency injection, the default setup for the SDK can be used:
-
-{DotNetStartupCode}
-
-```json title="appsettings.json"
-{
- "ABSmartly": {
- "Environment": "development",
- "Application": "website",
- "Endpoint": "https://your-company.absmartly.io/v1",
- "ApiKey": "YOUR-API-KEY"
- }
-}
-```
-
-The `ABSdk` instance is then added as a singleton and can be injected wherever
-necessary:
-
-{DotNetSDKInjection}
-
-The `AddABSmartly` extension method allows for configuring SDK settings, configuring HTTP
-connection settings, injecting custom implementations of context-specific services
-and configuring additional HTTP requests policies using Polly.
-
-Alternatively, an SDK instance can be created manually like in the following
-example:
-
-{DotNetManualSDKInstance}
-
-The SDK uses `IHttpClientFactory` abstraction to effectively manage the HTTP
-connections pool. This factory is injected using `IABSdkHttpClientFactory`
-as seen in the example above. If you require custom behavior or implementation,
-you can inject your own implementation of the `IHttpClientFactory` or
-the `IABSdkHttpClientFactory`.
-
-If you are injecting your own `IABSdkHttpClientFactory` implementation, make
-sure it creates named `IHttpClient` instances with the name `ABSmartlySDK.HttpClient`
-(you can use a static field in the `ABSdk` class, `ABSdk.HttpClientName`).
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :---------- | :----------------------------------- | :-------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| retries | `number` | ❌ | `5` | The number of retries before the SDK stops trying to connect. |
-| timeout | `number` | ❌ | `3000` | An amount of time, in milliseconds, before the SDK will stop trying to connect. |
-| eventLogger | `(context, eventName, data) => void` | ❌ | See [Using a Custom Event Logger](#using-a-custom-event-logger) below | A callback function which runs after SDK events. |
-
-
-
-
-
-{PHPImportAndInitialize}
-
-Note that the above example uses named parameters introduced in PHP 8.0.
-Although it is strongly recommended to use the latest PHP version, PHP 7.4 is
-supported as well. On PHP 7.4, parameters are only passed in their order, as
-named parameters are not supported.
-
-**For example:**
-
-{PHPParamsInOrder}
-
-The above is a short-cut that creates an SDK instance quickly using default
-values. If you would like granular choice of individual components (such as a
-custom event logger), it can be done as following:
-
-{PHPGranularChoice}
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :------------ | :------------------------------------------ | :-------: | :-------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `endpoint` | string | ✅ | _undefined_ | The URL to your API endpoint. Most commonly "your-company.absmartly.io" |
-| `apiKey` | `string` | ✅ | _undefined_ | Your API key which can be found on the Web Console. |
-| `environment` | `"production"` or `"development"` | ✅ | _undefined_ | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| `application` | `string` | ✅ | _undefined_ | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| `retries` | `int` | ❌ | 5 | The number of retries before the SDK stops trying to connect. |
-| `timeout` | `int` | ❌ | `3000` | An amount of time, in milliseconds, before the SDK will stop trying to connect. |
-| `eventLogger` | `\ABSmartly\SDK\Context\ContextEventLogger` | ❌ | `null`, See Using a Custom Event Logger below | A callback function which runs after SDK events. |
-
-
-
-
-
-{RubyImport}
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :---------- | :----------------------------------- | :-------: | :-------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-| retries | `number` | ❌ | `5` | The number of retries before the SDK stops trying to connect. |
-| timeout | `number` | ❌ | `3000` | An amount of time, in milliseconds, before the SDK will stop trying to connect. |
-| eventLogger | `(context, eventName, data) => void` | ❌ | See "Using a Custom Event Logger" below | A callback function which runs after SDK events. |
-
-
-
-
-
-{FlutterImport}
-
-**SDK Options**
-
-| Config | Type | Required? | Default | Description |
-| :---------- | :-------------------------------- | :-------: | :---------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| endpoint | `string` | ✅ | `undefined` | The URL to your API endpoint. Most commonly `"your-company.absmartly.io"` |
-| apiKey | `string` | ✅ | `undefined` | Your API key which can be found on the Web Console. |
-| environment | `"production"` or `"development"` | ✅ | `undefined` | The environment of the platform where the SDK is installed. Environments are created on the Web Console and should match the available environments in your infrastructure. |
-| application | `string` | ✅ | `undefined` | The name of the application where the SDK is installed. Applications are created on the Web Console and should match the applications where your experiments will be running. |
-
-
-
-
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/manualSDKInstance.cs b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/manualSDKInstance.cs
deleted file mode 100644
index c33bcb8e..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/manualSDKInstance.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using ABSmartly;
-using ABSmartly.Services;
-using Microsoft.Extensions.DependencyInjection;
-
-var serviceProvider = new ServiceCollection().AddHttpClient().BuildServiceProvider();
-var httpClientFactory = serviceProvider.GetService();
-
-var abSdk = new ABSdk(new ABSdkHttpClientFactory(httpClientFactory), new ABSmartlyServiceConfiguration
-{
- Environment = "development",
- Application = "website",
- Endpoint = "https://your-company.absmartly.io/v1",
- ApiKey = "YOUR-API-KEY"
-});
-
-...
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/sdkInjection.cs b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/sdkInjection.cs
deleted file mode 100644
index 6ed583a2..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/sdkInjection.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using ABSmartly;
-using Microsoft.AspNetCore.Mvc;
-
-[ApiController]
-[Route("[controller]")]
-public class Test : ControllerBase
-{
- private readonly ABSdk \_abSdk;
-
- public Test(ABSdk abSdk)
- {
- _abSdk = abSdk;
- }
-
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/startupCode.cs b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/startupCode.cs
deleted file mode 100644
index 9c0b1fc8..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/dotnet/startupCode.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using ABSmartly;
-using ABSmartly.DependencyInjection;
-
-var builder = WebApplication.CreateBuilder(args);
-
-...
-
-builder.Services.AddABSmartly(builder.Configuration.GetSection("ABSmartly"), HttpClientConfig.CreateDefault());
-
-...
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/flutter/import.dart b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/flutter/import.dart
deleted file mode 100644
index c49890cb..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/flutter/import.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-void main() async{
- final ClientConfig clientConfig = ClientConfig()
- ..setEndpoint("https://your-company.absmartly.io/v1")
- ..setAPIKey("YOUR API KEY")
- ..setApplication("website")
- ..setEnvironment("development");
-
- final ABSmartlyConfig sdkConfig = ABSmartlyConfig.create()
- .setClient(Client.create(clientConfig));
- final ABSmartly sdk = ABSmartly(sdkConfig);
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/go/initialize.go b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/go/initialize.go
deleted file mode 100644
index d6ae88e0..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/go/initialize.go
+++ /dev/null
@@ -1,14 +0,0 @@
-func main() {
- var clientConfig = ClientConfig{
- Endpoint_: "https://your-company.absmartly.io/v1",
- ApiKey_: os.Getenv("ABSMARTLY_APIKEY"),
- Application_: os.Getenv(`ABSMARTLY_APPLICATION`), // created in the ABSmartly web console
- Environment_: os.Getenv(`ABSMARTLY_ENVIRONMENT`) // created in the ABSmartly web console
- }
-
- var sdkConfig = ABSmartlyConfig{Client_: CreateDefaultClient(clientConfig)}
-
- var sdk = Create(sdkConfig)
-
- // ...
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/java/import.java b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/java/import.java
deleted file mode 100644
index b88c8ce5..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/java/import.java
+++ /dev/null
@@ -1,21 +0,0 @@
-import com.absmartly.sdk.*;
-
-public class Example {
- static public void main(String[] args) {
-
- final ClientConfig clientConfig = ClientConfig.create()
- .setEndpoint("https://your-company.absmartly.io/v1")
- .setAPIKey("YOUR-API-KEY")
- .setApplication("website") // created in the ABSmartly Web Console
- .setEnvironment("development"); // created in the ABSmartly Web Console
-
- final Client absmartlyClient = Client.create(clientConfig);
-
- final ABSmartlyConfig sdkConfig = ABSmartlyConfig.create()
- .setClient(absmartlyClient);
-
-
- final ABSmartly sdk = ABSmartly.create(sdkConfig);
- // ...
- }
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/java/importForAndroid6.java b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/java/importForAndroid6.java
deleted file mode 100644
index 86343a29..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/java/importForAndroid6.java
+++ /dev/null
@@ -1,22 +0,0 @@
-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") // created in the ABSmartly Web Console
- .setEnvironment("development"); // created in the ABSmartly Web Console
-
- 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);
- // ...
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/js/import.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/js/import.js
deleted file mode 100644
index c1ff79f7..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/js/import.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// ES6 Modules
-import absmartly from "@absmartly/javascript-sdk";
-
-// For commonJS, use:
-// const absmartly = require("@absmartly/javascript-sdk");
-
-const sdk = new absmartly.SDK({
- endpoint: "https://your-company.absmartly.io/v1",
- apiKey: process.env.ABSMARTLY_API_KEY,
- environment: process.env.NODE_ENV,
- application: process.env.APPLICATION_NAME,
-});
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/granularChoice.php b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/granularChoice.php
deleted file mode 100644
index 3e5e8955..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/granularChoice.php
+++ /dev/null
@@ -1,22 +0,0 @@
-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('', '', '', '');
-$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);
-
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/importAndInitialize.php b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/importAndInitialize.php
deleted file mode 100644
index b91a7c5a..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/importAndInitialize.php
+++ /dev/null
@@ -1,8 +0,0 @@
-use \ABSmartly\SDK\SDK;
-
-$sdk = SDK::createWithDefaults(
- endpoint: 'https://your-company.absmartly.io/v1',
- apiKey: $apiKey,
- environment: $environment,
- application: $application
-);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/paramsInOrder.php b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/paramsInOrder.php
deleted file mode 100644
index 337c271f..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/php/paramsInOrder.php
+++ /dev/null
@@ -1,5 +0,0 @@
-use \ABSmartly\SDK\SDK;
-
-$sdk = SDK::createWithDefaults(
- 'https://your-company.absmartly.io/v1', $apiKey, $environment, $application,
-);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/python/import.py b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/python/import.py
deleted file mode 100644
index 81324e57..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/python/import.py
+++ /dev/null
@@ -1,15 +0,0 @@
-def main():
- client_config = ClientConfig()
- client_config.endpoint = "https://your-company.absmartly.io/v1"
- client_config.api_key = "test"
- client_config.application = "www"
- client_config.environment = "prod"
-
- default_client_config = DefaultHTTPClientConfig()
- default_client = DefaultHTTPClient(default_client_config)
- sdk_config = ABSmartlyConfig()
- sdk_config.client = Client(client_config, default_client)
- sdk = ABSmartly(sdk_config)
-
- context_config = ContextConfig()
- ctx = sdk.create_context(context_config)
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/react/import.jsx b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/react/import.jsx
deleted file mode 100644
index f5968f32..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/react/import.jsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import React from "react";
-import ReactDOM from "react-dom";
-import App from "./App";
-
-import ABSmartly from "@absmartly/react-sdk";
-
-const contextOptions = {
- units: {
- userId: "123",
- session_id: "5ebf06d8cb5d8137290c4abb64155584fbdb64d8",
- email: "support@absmartly.com",
- deviceId: "345",
- },
-};
-
-ReactDOM.render(
-
-
- ,
- document.getElementById("root")
-);
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/ruby/import.rb b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/ruby/import.rb
deleted file mode 100644
index dd792c8c..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/ruby/import.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-Absmartly.configure_client do |config|
- config.endpoint = "https://your-company.absmartly.io/v1"
- config.api_key = "YOUR-API-KEY"
- config.application = "website"
- config.environment = "development"
-end
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/swift/import.swift b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/swift/import.swift
deleted file mode 100644
index 9845b495..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/swift/import.swift
+++ /dev/null
@@ -1,17 +0,0 @@
-import ABSmartly
-
-let sdk: ABSmartlySDK
-do {
- let clientConfig = ClientConfig(
- apiKey: ProcessInfo.processInfo.environment["ABSMARTLY_API_KEY"] ?? "",
- application: ProcessInfo.processInfo.environment["ABSMARTLY_APPLICATION"] ?? "",
- endpoint: "https://your-company.absmartly.io/v1",
- environment: ProcessInfo.processInfo.environment["ABSMARTLY_ENVIRONMENT"] ?? ""))
-
- let client = try DefaultClient(config: clientConfig)
- let sdkConfig = ABSmartlyConfig(client: client)
- sdk = try ABSmartlySDK(config: sdkConfig)
-} catch {
- print(error.localizedDescription)
- return
-}
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/vue/import.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/vue/import.js
deleted file mode 100644
index 6dceb821..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/vue/import.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import absmartly from "@absmartly/vue2-sdk";
-
-// For commonJS, use:
-// const absmartly = require('@absmartly/vue2-sdk');
-
-// Somewhere in your application initialization code, before mounting your Vue application
-Vue.use(absmartly.ABSmartlyVue, {
- sdkOptions: {
- endpoint: "https://your-company.absmartly.io/v1",
- apiKey: ABSMARTLY_API_KEY,
- environment: "production",
- application: "website",
- },
- context: {
- units: {
- session_id: "5ebf06d8cb5d8137290c4abb64155584fbdb64d8",
- },
- },
- attributes: {
- user_agent: navigator.userAgent,
- },
-});
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/vue3/import.js b/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/vue3/import.js
deleted file mode 100644
index 7feb5d4c..00000000
--- a/docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/vue3/import.js
+++ /dev/null
@@ -1,25 +0,0 @@
-const absmartly = require('@absmartly/vue3-sdk');
-// OR with ES6 modules:
-import absmartly from '@absmartly/vue3-sdk';
-
-// create vue app ...
-
-app.use(absmartly.ABSmartlyVue, {
- sdkOptions: {
- endpoint: 'https://your-company.absmartly.io/v1',
- apiKey: ABSMARTLY_API_KEY,
- environment: "production",
- application: "website",
- },
- context: {
- units: {
- session_id: '5ebf06d8cb5d8137290c4abb64155584fbdb64d8',
- },
- },
- attributes: {
- user_agent: navigator.userAgent
- },
- overrides: {
- exp_test_development: 1
- }
-});
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/index.mdx b/docs/APIs-and-SDKs/SDK-Documentation/index.mdx
index 075f4c90..4c30ba4c 100644
--- a/docs/APIs-and-SDKs/SDK-Documentation/index.mdx
+++ b/docs/APIs-and-SDKs/SDK-Documentation/index.mdx
@@ -1,30 +1,51 @@
-# SDK Documentation
+---
+sidebar_position: 1
+title: SDK Guide
+---
-This guide provides detailed information about ABsmartly’s experimentation
-SDKs.
+# ABsmartly SDK Guide
-We currently support:
+The ABsmartly SDK lets you run experiments and feature flags in your application. It handles variant assignment, exposure tracking, and goal measurement so you can focus on building the experiences you want to test.
+
+## Supported SDKs
+
+**Client-side:**
-- [Java](https://www.github.com/absmartly/java-sdk)
- [Javascript](https://www.github.com/absmartly/javascript-sdk)
-- [Swift](https://www.github.com/absmartly/swift-sdk)
- [React](https://www.github.com/absmartly/react-sdk)
- [Vue2](https://www.github.com/absmartly/vue2-sdk)
- [Vue3](https://www.github.com/absmartly/vue3-sdk)
-- [PHP](https://www.github.com/absmartly/php-sdk)
-- [.NET](https://www.github.com/absmartly/dotnet-sdk)
-- [Ruby](https://www.github.com/absmartly/ruby-sdk)
-- [Golang](https://www.github.com/absmartly/go-sdk)
+- [Swift](https://www.github.com/absmartly/swift-sdk)
- [Flutter/Dart](https://www.github.com/absmartly/flutter-sdk)
+
+**Server-side:**
+
+- [Javascript](https://www.github.com/absmartly/javascript-sdk)
+- [Java](https://www.github.com/absmartly/java-sdk)
- [Python3](https://www.github.com/absmartly/python3-sdk)
+- [Golang](https://www.github.com/absmartly/go-sdk)
+- [.NET](https://www.github.com/absmartly/dotnet-sdk)
+- [PHP](https://www.github.com/absmartly/php-sdk)
+- [Ruby](https://www.github.com/absmartly/ruby-sdk)
+
+## Where to start
+
+If you're new to ABsmartly, follow this path:
+
+1. **[Getting Started](./getting-started)** - Install the SDK, initialise it, and create your first context.
+2. **[Running Your First Experiment](./running-your-first-experiment)** - Walk through a complete experiment from variant assignment to goal tracking.
-Have a look at [our Github](https://github.com/absmartly) to see our current
-SDKs and those which are still in development (here's looking at **you** Python
-developers)!
+These two pages are all you need to start running experiments. When you're ready,
+explore the topics that matter for your use case. You don't need to read them in
+order - pick the ones relevant to your project:
+ - [Managing the Context Lifecycle](./managing-the-context-lifecycle) - When and how to publish events, close contexts, and refresh experiment data.
+ - [Pre-Fetching Context Data](./pre-fetching-context-data) - Fetch experiment data on the server and pass it to the client to avoid flickering.
+ - [Targeting Users and Controlling Assignments](./targeting-and-audiences) - Pass user attributes, set custom assignments, and override variants for QA.
+ - [Checking Variants Without Triggering Exposures](./checking-variants-without-exposures) - Peek at treatments without recording an exposure.
+ - [Using Variables as Code](./using-variables-as-code) - Inject HTML, CSS, or functions from the Web Console.
+ - [Using Custom Fields](./using-custom-fields) - Extend experiment metadata with your own fields.
+ - [Config API](./config-api) - Merge experiment data directly into your app's config objects.
:::note
-This guide assumes that you are already partnered with us and your Web Console
-has been setup by our team. If you are looking to start your experimentation
-journey, [request a demo](https://absmartly.com/elite-experimenter) with one of our
-teammembers!
+This guide assumes your Web Console is already set up by our team. If you're looking to get started with ABsmartly, [request a demo](https://absmartly.com/elite-experimenter) with one of our team members.
:::
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/managing-the-context-lifecycle.mdx b/docs/APIs-and-SDKs/SDK-Documentation/managing-the-context-lifecycle.mdx
new file mode 100644
index 00000000..a8879d2a
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/managing-the-context-lifecycle.mdx
@@ -0,0 +1,605 @@
+---
+sidebar_position: 4
+---
+
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import Publish from "./_shared/publish/_publish.mdx";
+import Finalize from "./_shared/finalize/_finalize.mdx";
+
+# Managing the Context Lifecycle
+
+:::tip Skip for now?
+If you're building a single-page app and just getting started, you can skip this page.
+The SDK handles event batching and sending automatically. Come back here when you need
+to control the timing of event delivery or manage long-lived contexts.
+:::
+
+Most of the time the SDK handles event delivery and cleanup automatically. But there are
+situations where you need to take control: flushing events before a page navigation,
+closing a context when a user logs out, or refreshing experiment data in a long-running
+process.
+
+## Flushing events with publish
+
+Most SDKs batch events and send them automatically after a short delay. You don't need
+to call `publish()` for typical use cases.
+
+:::warning Node.js, PHP, and Ruby users
+The Javascript SDK running in Node.js, the PHP SDK, and the Ruby SDK do not
+auto-publish events. The typical pattern is to create a context at the beginning of each
+request, use it throughout the request to check treatments and track goals, and then call
+`publish()` or `finalize()` at the end before sending the response. This ensures all
+events are sent and the context is cleaned up before the request ends.
+:::
+
+Even in SDKs with auto-publishing enabled, there are times when you need to make sure
+events are sent right now, before moving on:
+
+- **Before a server sends its response.** In server-side rendering, the context might
+ get garbage collected before the auto-flush fires. Call `publish()` before sending the
+ response to make sure exposure and goal data gets recorded.
+- **Before a page navigation.** In a traditional multi-page app, navigating away can
+ interrupt the SDK's flush cycle. Call `publish()` before `window.location` changes.
+- **Before a critical business event.** If you need confirmation that goal data was
+ recorded before proceeding (e.g., before showing an order confirmation), flush first.
+
+You probably **don't** need `publish()` if:
+
+- You're in a single-page app where the context lives for the whole session
+- You're calling `finalize()` at the end anyway (it flushes automatically)
+- You're just tracking goals in a normal flow and the SDK's auto-flush is fine
+
+
+
+## Closing a context with finalize
+
+Finalizing (or closing) a context does two things: it flushes any remaining events
+(like `publish()`), and then it "seals" the context so no more events can be recorded.
+Any `track()` or `publish()` calls after finalize will throw an error. Calls to
+`treatment()` and `variableValue()` still return the correct values (assignments are
+computed locally), but no new exposures will be recorded.
+
+You should finalize a context when:
+
+- **A user logs out.** You no longer know if the current user is the same person. Close
+ the old context and create a new one with an `anonymous_id`.
+- **Your application is shutting down.** Whether it's a server process exiting, a mobile
+ app going to background, or a component unmounting, finalize ensures nothing gets lost.
+- **A server-side request is complete.** Each request should create and finalize its own
+ context so events are flushed promptly.
+
+
+
+## Adding units after context creation
+
+Sometimes you don't have all of a user's identifiers when you first create the context.
+For example, you might create a context with an `anonymous_id` and later learn the
+`user_id` when they log in. You can add units to an existing context without creating
+a new one.
+
+
+
+
+
+```js
+context.unit("db_user_id", "1000013");
+
+context.units({
+ db_user_id: "1000013",
+});
+```
+
+
+
+
+
+```python
+context.set_unit("db_user_id", "1000013")
+
+context.set_units({
+ "db_user_id": "1000013"
+})
+```
+
+
+
+
+
+```jsx
+const { context } = useABSmartly();
+
+context.unit("db_user_id", "1000013");
+```
+
+In React, if the user's identity changes entirely (for example, they log out and a
+different user logs in), use `resetContext()` to replace the context with a fresh one:
+
+```jsx
+const { resetContext } = useABSmartly();
+
+resetContext({
+ units: {
+ anonymous_id: "new-anonymous-id",
+ },
+});
+```
+
+
+
+
+
+```js
+this.$absmartly.unit("db_user_id", "1000013");
+
+this.$absmartly.units({
+ db_user_id: "1000013",
+});
+```
+
+
+
+
+
+```js
+this.$absmartly.unit("db_user_id", "1000013");
+
+this.$absmartly.units({
+ db_user_id: "1000013",
+});
+```
+
+
+
+
+
+```swift
+context.setUnit(unitType: "db_user_id", uid: "1000013")
+context.setUnits([
+ "db_user_id": "1000013"
+])
+```
+
+
+
+
+
+```java
+context.setUnit("db_user_id", "1000013");
+
+context.setUnits(Map.of(
+ "db_user_id", "1000013"
+));
+```
+
+
+
+
+
+```go
+context.SetUnit("db_user_id", "1000013")
+
+context.SetUnits(map[string]string{
+ "db_user_id": "1000013",
+})
+```
+
+
+
+
+
+```csharp
+context.SetUnit("db_user_id", "1000013");
+
+context.SetUnits(new Dictionary() {
+ { "db_user_id", "1000013" }
+});
+```
+
+
+
+
+
+```php
+$context->setUnit('db_user_id', '1000013');
+```
+
+
+
+
+
+```ruby
+context.set_unit("db_user_id", "1000013")
+```
+
+
+
+
+
+```dart
+context.setUnit("db_user_id", "1000013");
+context.setUnits({
+ "db_user_id": "1000013"
+});
+```
+
+
+
+
+
+:::caution
+You **cannot override** a unit type that has already been set. Setting `user_id` twice
+with different values is a change of identity and will throw an exception. If the user's
+identity changes (for example, they log out), finalize the old context and create a new
+one.
+:::
+
+## Refreshing experiment data
+
+When you create a context, the SDK fetches all running experiments and caches them in
+memory. But if your application runs for a long time (like a Node.js server or a
+single-page app that stays open all day), new experiments started after the context
+was created won't be picked up.
+
+There are two ways to handle this:
+
+**Automatic refresh:** Set a refresh interval when creating the context. The SDK will
+periodically re-fetch experiment data in the background.
+
+:::info Refresh interval units
+The unit for the refresh interval varies by SDK. Javascript, Java, Go, PHP, and
+Flutter use **milliseconds**. Python, Ruby, and Swift use **seconds**. .NET uses
+`TimeSpan`.
+:::
+
+
+
+
+
+```js
+const context = sdk.createContext(
+ { units: { user_id: "user-12345" } },
+ { refreshPeriod: 30000 } // 30000 ms = 30 seconds
+);
+```
+
+
+
+
+
+```python
+context_config = ContextConfig()
+context_config.units = {"user_id": "user-12345"}
+context_config.refresh_interval = 30 # 30 seconds (Python uses seconds, not milliseconds)
+
+ctx = sdk.create_context(context_config)
+```
+
+
+
+
+
+```jsx
+
+
+
+```
+
+
+
+
+
+```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",
+ },
+ },
+ contextOptions: {
+ refreshPeriod: 30000, // 30000 ms = 30 seconds
+ },
+});
+```
+
+
+
+
+
+```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",
+ },
+ },
+ contextOptions: {
+ refreshPeriod: 30000, // 30000 ms = 30 seconds
+ },
+});
+```
+
+
+
+
+
+```java
+final ContextConfig contextConfig = ContextConfig.create()
+ .setUnit("user_id", "user-12345")
+ .setRefreshInterval(30000); // 30000 ms = 30 seconds
+
+final Context context = sdk.createContext(contextConfig).waitUntilReady();
+```
+
+
+
+
+
+```go
+contextConfig := ContextConfig{
+ Units_: map[string]string{
+ "user_id": "user-12345",
+ },
+ RefreshInterval_: 30000, // 30000 ms = 30 seconds
+}
+
+ctx := sdk.CreateContext(contextConfig)
+ctx.WaitUntilReady()
+```
+
+
+
+
+
+```csharp
+var config = new ContextConfig()
+ .SetUnit("user_id", "user-12345");
+config.RefreshInterval = TimeSpan.FromSeconds(30);
+
+var context = await sdk.CreateContextAsync(config);
+```
+
+
+
+
+
+```php
+$contextConfig = new ContextConfig();
+$contextConfig->setUnit('user_id', 'user-12345');
+$contextConfig->setRefreshInterval(30000); // 30000 ms = 30 seconds
+
+$context = $sdk->createContext($contextConfig);
+```
+
+
+
+
+
+```ruby
+context_config = Absmartly.create_context_config
+context_config.unit("user_id", "user-12345")
+context_config.refresh_interval = 30 # 30 seconds (Ruby uses seconds, not milliseconds)
+
+context = Absmartly.create_context(context_config)
+```
+
+
+
+
+
+```swift
+let contextConfig = ContextConfig()
+contextConfig.setUnit(unitType: "user_id", uid: "user-12345")
+contextConfig.refreshInterval = 30 // 30 seconds (Swift uses seconds, not milliseconds)
+
+let context = sdk.createContext(config: contextConfig)
+```
+
+
+
+
+
+```dart
+final ContextConfig contextConfig = ContextConfig.create()
+ .setUnit("user_id", "user-12345")
+ .setRefreshInterval(30000); // 30000 ms = 30 seconds
+
+final Context? context = sdk.createContext(contextConfig);
+```
+
+
+
+
+
+**Manual refresh:** Call the `refresh()` method when you know experiment data might have
+changed. For example, after deploying a new experiment, or on a periodic schedule you
+control.
+
+
+
+
+
+```js
+await context.refresh();
+```
+
+
+
+
+
+```python
+ctx.refresh()
+```
+
+
+
+
+
+```jsx
+const { context } = useABSmartly();
+
+await context.refresh();
+```
+
+
+
+
+
+```js
+await this.$absmartly.refresh();
+```
+
+
+
+
+
+```js
+await this.$absmartly.refresh();
+```
+
+
+
+
+
+```java
+context.refresh();
+```
+
+
+
+
+
+```go
+ctx.Refresh()
+```
+
+
+
+
+
+```csharp
+context.Refresh();
+// or asynchronously:
+await context.RefreshAsync();
+```
+
+
+
+
+
+```php
+$context->refresh();
+```
+
+
+
+
+
+```ruby
+context.refresh
+```
+
+
+
+
+
+```swift
+context.refresh()
+```
+
+
+
+
+
+```dart
+context.refresh();
+```
+
+
+
+
+
+For most server-side apps where contexts are short-lived (one per request), you don't
+need refreshing at all. It's mainly useful for long-lived client-side contexts.
+
+## HTTP request options (Javascript SDK)
+
+
+Per-request timeout
+
+You can override the global timeout for individual HTTP requests. This is useful when
+a specific request (like context creation) can tolerate a different timeout than the
+SDK default.
+
+```js
+const context = sdk.createContext(
+ request,
+ {
+ refreshInterval: 5 * 60 * 1000,
+ },
+ {
+ timeout: 1500,
+ }
+);
+```
+
+
+
+
+Request cancellation
+
+You can cancel an in-flight HTTP request using an `AbortSignal`. This is useful when
+the user navigates away before the context is ready.
+
+The SDK bundles its own `AbortController` polyfill for older platforms that don't
+support it natively (via `absmartly.AbortController`). On modern browsers and
+Node.js 15+, the native implementation is used automatically.
+
+```js
+const controller = new absmartly.AbortController();
+const context = sdk.createContext(
+ request,
+ {
+ refreshInterval: 5 * 60 * 1000,
+ },
+ {
+ signal: controller.signal,
+ }
+);
+
+// Abort the request if not ready after 1500ms
+const timeoutId = setTimeout(() => controller.abort(), 1500);
+
+await context.ready();
+
+clearTimeout(timeoutId);
+```
+
+
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/pre-fetching-context-data.mdx b/docs/APIs-and-SDKs/SDK-Documentation/pre-fetching-context-data.mdx
new file mode 100644
index 00000000..05bdb7a2
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/pre-fetching-context-data.mdx
@@ -0,0 +1,351 @@
+---
+sidebar_position: 5
+---
+
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import CodeBlock from "@theme/CodeBlock";
+
+# Pre-Fetching Context Data
+
+Every time you call `createContext()`, the SDK makes a round-trip to the ABsmartly
+collector to fetch experiment data. In many situations you can avoid that round-trip
+by reusing data you've already fetched. That's what `createContextWith()` is for --
+it creates a context from data you provide, so the context is ready immediately with
+no network request.
+
+This is supported across all ABsmartly SDKs.
+
+## Why pre-fetch?
+
+There are two common reasons to pre-fetch context data:
+
+**Avoiding flickering on the client.** When you create a context client-side, the
+round-trip to the collector means your UI doesn't know which variant to show until the
+response comes back. The result is either a loading state or a flash of the wrong
+content. If you fetch the data on the server and pass it to the client, the context is
+ready on the first render.
+
+**Reducing latency on the server.** If your server handles many requests for the same
+set of experiments, you can fetch the context data once and cache it (in memory, Redis,
+or wherever makes sense for your setup). Subsequent requests can create contexts from
+the cached data instead of making a round-trip to the collector each time.
+
+## How it works
+
+1. Create a context normally with `createContext()` and wait for it to be ready
+2. Extract the experiment data with `context.data()`
+3. Store or transfer that data however you like
+4. Create new contexts with `createContextWith()`, passing in the stored data
+
+A context created with `createContextWith()` is ready immediately. It has the same
+behaviour as a normal context - it tracks exposures, records goals, and publishes
+events. The only difference is that it skips the initial fetch.
+
+
+
+
+
+```js
+const sdk = new absmartly.SDK(sdkOptions);
+
+// Fetch once
+const context = sdk.createContext(contextOptions);
+await context.ready();
+const data = context.data();
+
+// Reuse the data to create new contexts instantly
+const newContext = sdk.createContextWith(contextOptions, data);
+```
+
+
+
+
+
+The React SDK re-exports everything from `@absmartly/javascript-sdk`, so you
+don't need to install the JS SDK separately.
+
+```jsx
+import ABSmartly, { SDK } from "@absmartly/react-sdk";
+
+const sdk = new SDK(sdkOptions);
+const context = sdk.createContextWith(contextOptions, prefetchedData);
+
+
+
+
+```
+
+
+
+
+
+Pass pre-fetched data to the plugin's `data` option to skip the initial network request.
+
+```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",
+ },
+ },
+ data: prefetchedData,
+});
+```
+
+
+
+
+
+Pass pre-fetched data to the plugin's `data` option to skip the initial network request.
+
+```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",
+ },
+ },
+ data: prefetchedData,
+});
+```
+
+
+
+
+
+```python
+sdk = ABSmartly(sdk_options)
+
+# Fetch once
+context = sdk.create_context(context_config)
+context.wait_until_ready()
+data = context.get_data()
+
+# Reuse
+new_context = sdk.create_context_with(context_config, data)
+```
+
+
+
+
+
+```java
+ABSmartly sdk = ABSmartly.create(sdkConfig);
+
+// Fetch once
+Context context = sdk.createContext(contextConfig);
+context.waitUntilReady();
+ContextData data = context.getData();
+
+// Reuse
+Context newContext = sdk.createContextWith(contextConfig, data);
+```
+
+
+
+
+
+```go
+sdk := absmartly.Create(sdkConfig)
+
+// Fetch once
+context := sdk.CreateContext(contextConfig)
+context.WaitUntilReady()
+data := context.GetData()
+
+// Reuse
+newContext := sdk.CreateContextWith(contextConfig, data)
+```
+
+
+
+
+
+```csharp
+var sdk = new ABSdk(sdkConfig);
+
+// Fetch once
+var context = sdk.CreateContext(contextConfig);
+context.WaitUntilReady();
+var data = context.GetContextData();
+
+// Reuse
+var newContext = sdk.CreateContextWith(contextConfig, data);
+```
+
+
+
+
+
+```php
+$sdk = new SDK($sdkConfig);
+
+// Fetch once
+$context = $sdk->createContext($contextConfig);
+$data = $context->getContextData();
+
+// Reuse
+$newContext = $sdk->createContextWithData($contextConfig, $data);
+```
+
+
+
+
+
+```ruby
+# Fetch once
+context_config = Absmartly.create_context_config
+context_config.unit("user_id", "user-12345")
+
+context = Absmartly.create_context(context_config)
+data = context.data
+
+# Reuse
+new_context = Absmartly.create_context_with(context_config, data)
+```
+
+
+
+
+
+```swift
+let sdk = ABSmartlySDK(config: sdkConfig)
+
+// Fetch once
+let context = sdk.createContext(config: contextConfig)
+context.waitUntilReady()
+let data = context.getContextData()
+
+// Reuse
+let newContext = sdk.createContextWithData(config: contextConfig, contextData: data)
+```
+
+
+
+
+
+```dart
+final sdk = ABSmartly(sdkConfig);
+
+// Fetch once
+final context = sdk.createContext(contextConfig);
+await context.waitUntilReady();
+final data = context.getData();
+
+// Reuse
+final newContext = sdk.createContextWith(contextConfig, data);
+```
+
+
+
+
+
+## Use case: server-side caching
+
+On a high-traffic server, you might not want every request to make its own round-trip
+to the collector. Instead, you can fetch the context data on a schedule (or on first
+request) and cache it.
+
+```js
+let cachedData = null;
+
+async function refreshCache() {
+ const sdk = new absmartly.SDK(sdkOptions);
+ // Any unit works here - we're fetching experiment definitions, not
+ // computing assignments. Each context created with createContextWith()
+ // computes its own assignments locally.
+ const context = sdk.createContext({ units: { user_id: "cache-warm" } });
+ await context.ready();
+ cachedData = context.data();
+}
+
+function handleRequest(userId) {
+ const sdk = new absmartly.SDK(sdkOptions);
+ const context = sdk.createContextWith({ units: { user_id: userId } }, cachedData);
+ // context is ready immediately, no round-trip
+ const variant = context.treatment("experiment_name");
+}
+```
+
+The cached data contains experiment definitions, not user assignments. Assignments
+are computed locally by the SDK based on the user's units, so it's safe to share the
+same cached data across all users.
+
+## Use case: server to client (avoiding flicker)
+
+In a server-rendered app, you can fetch the context data during the server render and
+pass it to the client. This is the most common way to eliminate flickering.
+
+### Next.js example
+
+```tsx title="pages/index.tsx"
+import ABSmartly, { SDK } from "@absmartly/react-sdk";
+
+const sdkOptions = {
+ endpoint: "https://your-company.absmartly.io/v1",
+ apiKey: "YOUR-API-KEY",
+ application: "website",
+ environment: process.env.NODE_ENV,
+};
+
+export const getServerSideProps: GetServerSideProps = async () => {
+ const serverSDK = new SDK(sdkOptions);
+
+ const contextOptions = {
+ units: {
+ user_id: "user-123",
+ anonymous_id: "anon-456",
+ },
+ };
+
+ const context = serverSDK.createContext(contextOptions);
+ await context.ready();
+
+ return {
+ props: {
+ contextData: context.data(),
+ contextOptions,
+ sdkOptions,
+ },
+ };
+};
+
+export default function Home({ contextData, contextOptions, sdkOptions }) {
+ const clientSDK = new SDK(sdkOptions);
+ const context = clientSDK.createContextWith(contextOptions, contextData);
+
+ return (
+
+ {/* Your page content */}
+
+ );
+}
+```
+
+The server fetches the experiment data during `getServerSideProps`, serialises it as
+a prop, and the client creates the context instantly with `createContextWith()`. The
+user sees the correct variant on the very first paint.
+
+## Related topics
+
+- [Targeting Users and Controlling Assignments](./targeting-and-audiences) shows how
+ to pass user attributes, use custom assignments, and override variants during QA.
+- [Using Custom Fields](./using-custom-fields) covers adding per-experiment metadata
+ for advanced use cases.
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/running-your-first-experiment.mdx b/docs/APIs-and-SDKs/SDK-Documentation/running-your-first-experiment.mdx
new file mode 100644
index 00000000..3abec480
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/running-your-first-experiment.mdx
@@ -0,0 +1,129 @@
+---
+sidebar_position: 3
+---
+
+import SelectingATreatment from "./_selecting-a-treatment-basic.mdx";
+import SelectingAVariable from "./_selecting-a-variable-basic.mdx";
+import TrackingGoals from "./_shared/tracking-goals/_tracking-goals.mdx";
+import Publish from "./_shared/publish/_publish.mdx";
+import CompleteExample from "./complete-example/_complete-example.mdx";
+
+# Running Your First Experiment
+
+Now that your SDK is set up and you have a context, you're ready to run an experiment.
+Here's what that looks like from your code's perspective:
+
+1. **Check the variant** to find out which experience this user should see
+2. **Render the right experience** based on that variant (or use variables to make it flexible)
+3. **Track goals** to measure whether the experiment is working
+4. **Send the data** to ABsmartly's collector
+
+Once the context is ready, all `treatment()` calls are resolved locally with no
+additional network requests. Any experiment that isn't running will return `0`
+(Variant A, the control group).
+
+Steps 1 and 3 are all you need for a basic experiment. Step 2 (variables) and
+Step 4 (manual event flushing) are useful but not required for your first test.
+
+## Step 1: Check which variant the user is in
+
+The `treatment()` method is how you find out which variant a user has been assigned to.
+It returns a number that maps to the variants you see in the Web Console:
+
+| Number | Web Console name | Meaning |
+|--------|-----------------|---------|
+| `0` | Variant A | Control (the baseline experience) |
+| `1` | Variant B | First treatment |
+| `2` | Variant C | Second treatment |
+| `3` | Variant D | Third treatment |
+| ... | ... | ... |
+
+Calling `treatment()` also records an **exposure**, which tells ABsmartly that this user
+actually saw the experiment. This is how ABsmartly knows to include them in the
+statistical analysis.
+
+Use an `if/else` block to branch your code based on the variant:
+
+
+
+This works well for experiments where the logic change is entirely in your code (show
+component A vs component B). But if you want the Web Console to control values like
+colours, copy, or feature flags, read on.
+
+## Step 2: Use variables for flexible experiments
+
+Instead of hardcoding what each variant does, you can use **treatment variables**.
+These are key-value pairs that you set in the Web Console and pull into your code at runtime.
+
+The benefit: your product team can add new variants or tweak existing ones from the Web
+Console without anyone touching code.
+
+For example, say you have an experiment to find out what colour of button gets the most
+clicks. In the Web Console, you'd add a variable called `button.color` with value `"green"`
+on Variant B. You don't need to set anything on Variant A - that's what the default value
+in your code is for. Then in your code, `variableValue()` returns the experiment value for
+the user's assigned variant, or the default if the experiment isn't running or the user is
+in the control group:
+
+
+
+## Step 3: Track goals to measure success
+
+An experiment without goals is like running a test without checking the results. Goals
+are the actions you want to measure: did the user click the button? Complete a purchase?
+Sign up for a newsletter?
+
+The `track()` method records these actions. Each goal corresponds to a `goal_name`
+defined in the Web Console. You can also pass properties to create more granular metrics.
+
+
+
+:::info
+- By default, the `goal_name` must match exactly what you defined in the Web Console.
+ Anything else will be ignored. However, if your instance has `AUTO_GOAL_CREATION`
+ enabled, any unseen goals will be automatically created in the Web Console.
+- Properties are optional but useful for filtering and creating extra metrics.
+:::
+
+## Step 4: Make sure your data gets sent
+
+Most SDKs batch events and send them to ABsmartly's collector automatically. For most
+use cases, you don't need to do anything here.
+
+:::warning Node.js, PHP, and Ruby users
+The Javascript SDK running in Node.js, the PHP SDK, and the Ruby SDK do not
+auto-publish events. You must call `publish()` or `finalize()` explicitly at the end of
+each request, or your exposure and goal data will not be sent.
+:::
+
+Even with auto-publishing, there are times when you need to guarantee events are sent
+before moving on. For example, before a page navigation in a multi-page app, or before
+a server sends its response. In those cases, call `publish()` explicitly:
+
+
+Using publish() to flush events manually
+
+
+
+
+
+## Putting it all together
+
+Here's a realistic starting point you can copy and adapt. It covers SDK init, context
+creation, treatment checking, variable usage, goal tracking, and cleanup.
+
+
+
+## Next steps
+
+You now have everything you need to run a basic experiment. When you're ready to go
+deeper:
+
+- [Managing the Context Lifecycle](./managing-the-context-lifecycle) covers when to
+ close contexts, refresh experiment data, and flush events.
+- [Pre-Fetching Context Data](./pre-fetching-context-data) shows how to fetch
+ experiment data on the server and pass it to the client to avoid flickering.
+- [Targeting Users and Controlling Assignments](./targeting-and-audiences) shows how
+ to pass user attributes, use custom assignments, and override variants during QA.
+- [Checking Variants Without Triggering Exposures](./checking-variants-without-exposures)
+ explains peeking, which is useful for pre-loading assets or debugging.
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/targeting-and-audiences.mdx b/docs/APIs-and-SDKs/SDK-Documentation/targeting-and-audiences.mdx
new file mode 100644
index 00000000..1ed01aaf
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/targeting-and-audiences.mdx
@@ -0,0 +1,82 @@
+---
+sidebar_position: 6
+---
+
+import SetAttributes from "./_shared/context-attributes/_setting-context-attributes.mdx";
+import CustomAssignments from "./_shared/custom-assignments/_custom-assignments.mdx";
+import Overriding from "./_shared/overriding/_overriding.mdx";
+
+# Targeting Users and Controlling Assignments
+
+Not every experiment should run for every user. Sometimes you want to target specific
+browsers, geographies, or user segments. Other times you need to override which variant
+a user sees for development, QA, or API-driven personalization.
+
+This page covers three related features. Jump to the one you need:
+
+- [**Attributes**](#passing-user-attributes-for-targeting) - pass user metadata so you can create audience segments in the Web Console
+- [**Custom assignments**](#custom-assignments) - programmatically choose which variant a user sees (counted as real data)
+- [**Overrides**](#overriding-variants-for-development-and-qa) - force a variant for testing without affecting experiment statistics
+
+:::info Key difference: custom assignments vs overrides
+Custom assignments are **counted as real experiment data**. Use them when an external
+system (ML model, third-party targeting) decides the variant and you want those users
+in your analysis. Overrides are **ignored by the statistics engine**. Use them for
+development and QA.
+:::
+
+## Passing user attributes for targeting
+
+Attributes are metadata about the user or request. Once you pass them to the SDK, you
+can use them in the Web Console to create audience segments that control who enters an
+experiment.
+
+A common example: you're running an experiment only for mobile users. Pass the
+`user_agent` attribute and the SDK will automatically parse it into browser, OS, and
+device attributes that you can filter on in the Web Console.
+
+Other useful attributes might include:
+
+- **Geographic data** like country or region
+- **Account properties** like subscription tier or account age
+- **Request metadata** like referrer or landing page
+
+
+
+## Custom assignments
+
+Sometimes you need to control which variant a user gets based on external logic. Maybe
+your recommendation engine determines the best variant, or you're integrating with a
+third-party targeting system that provides variant selections.
+
+Custom assignments let you do this. A few real scenarios:
+
+- **ML-driven variant selection.** Your model predicts which variant performs best for
+ each user segment, and you feed that into ABsmartly.
+- **Third-party targeting integration.** An external system decides the allocation, and
+ you pass it through to ABsmartly for tracking.
+- **Geography-based logic.** An API call determines the user's region, and you assign
+ variants accordingly.
+
+:::warning Important distinction
+Custom assignments are **counted as real experiment data**. ABsmartly's statistics engine
+will include these users in the analysis. If you just need to force a variant for
+development or QA, use [overrides](#overriding-variants-for-development-and-qa) instead.
+:::
+
+
+
+## Overriding variants for development and QA
+
+During development and QA, you need to see specific variants without polluting your
+experiment data. Overrides solve this. They force a particular variant for a user, but
+the event is marked as **ineligible** and completely ignored by ABsmartly's statistics
+engine.
+
+Use overrides when:
+
+- **You're developing a new variant** and need to see it in your local environment
+- **QA is testing** each variant before the experiment goes live
+- **A stakeholder wants a demo** of a specific variant
+
+
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/using-custom-fields.mdx b/docs/APIs-and-SDKs/SDK-Documentation/using-custom-fields.mdx
new file mode 100644
index 00000000..9328ba23
--- /dev/null
+++ b/docs/APIs-and-SDKs/SDK-Documentation/using-custom-fields.mdx
@@ -0,0 +1,191 @@
+---
+sidebar_position: 9
+---
+
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+
+# Using Custom Fields in Your Code
+
+Custom fields let you add your own metadata to experiments. You define them in the
+[Platform Settings on the Web Console](/docs/web-console-docs/configuration/settings#platform-settings),
+and they become available to the SDKs at runtime.
+
+This is useful when you need per-experiment configuration that goes beyond what ABsmartly
+provides out of the box. For example, you might want each experiment to specify a "developer
+variant" so your engineering team can easily test specific variants in production without
+affecting experiment data.
+
+:::info
+This feature is currently supported by the following SDKs:
+- Javascript (and React, Vue3 which inherit from it)
+- Java
+- Go
+- .NET
+- Ruby
+- Swift
+
+If your SDK is not listed here (Python, PHP, Flutter, Vue2), custom fields are not yet
+available. You can achieve similar per-experiment configuration by checking the experiment
+name directly in your code and maintaining a lookup table of per-experiment settings.
+:::
+
+## An Example
+
+Let's say you wish to override an experiment's allocation to a specific variant if the
+user is a member of your development team.
+
+### Creating a Custom Field
+
+Check out 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.
+
+
+
+
+
+```js
+const context = sdk.createContext({
+ units: { user_id: "user-12345" },
+});
+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);
+ }
+}
+```
+
+
+
+
+
+```java
+Context context = sdk.createContext(contextConfig).waitUntilReady();
+
+String[] experimentNames = context.getExperiments();
+for (String experimentName : experimentNames) {
+ Object developerVariant = context.getCustomFieldValue(experimentName, "developer_variant");
+
+ if (developerVariant != null && user.isDeveloper()) {
+ context.setOverride(experimentName, ((Number) developerVariant).intValue());
+ }
+}
+```
+
+
+
+
+
+```go
+ctx := sdk.CreateContext(contextConfig)
+ctx.WaitUntilReady()
+
+experimentNames, _ := ctx.GetExperiments()
+for _, experimentName := range experimentNames {
+ developerVariant := ctx.GetCustomFieldValue(experimentName, "developer_variant")
+
+ if developerVariant != nil && user.IsDeveloper {
+ ctx.SetOverride(experimentName, int(developerVariant.(float64)))
+ }
+}
+```
+
+
+
+
+
+```csharp
+var context = await sdk.CreateContextAsync(config);
+
+var experimentNames = context.GetExperiments();
+foreach (var experimentName in experimentNames) {
+ var developerVariant = context.GetCustomFieldValue(experimentName, "developer_variant");
+
+ if (developerVariant != null && user.IsDeveloper) {
+ context.SetOverride(experimentName, Convert.ToInt32(developerVariant));
+ }
+}
+```
+
+
+
+
+
+```ruby
+context = sdk.create_context(context_config)
+context.wait_until_ready
+
+context.experiments.each do |experiment_name|
+ developer_variant = context.custom_field_value(experiment_name, "developer_variant")
+
+ if developer_variant && user.developer?
+ context.set_override(experiment_name, developer_variant)
+ end
+end
+```
+
+
+
+
+
+```swift
+let context = sdk.createContext(config: contextConfig)
+context.waitUntilReady()
+
+let experimentNames = context.getExperiments()
+for experimentName in experimentNames {
+ if let developerVariant = context.getCustomFieldValue(
+ experimentName: experimentName, key: "developer_variant") as? Int,
+ user.isDeveloper {
+ context.setOverride(experimentName: experimentName, variant: 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 documentation](./targeting-and-audiences#overriding-variants-for-development-and-qa).
+:::
+
+## Next steps
+
+- [Targeting Users and Controlling Assignments](./targeting-and-audiences) covers
+ overrides and custom assignments in more detail.
+- [Config API](./config-api) shows another way to use experiment data without
+ branching logic in your code.
diff --git a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/code-as-a-variant-variable.mdx b/docs/APIs-and-SDKs/SDK-Documentation/using-variables-as-code.mdx
similarity index 58%
rename from docs/APIs-and-SDKs/SDK-Documentation/Advanced/code-as-a-variant-variable.mdx
rename to docs/APIs-and-SDKs/SDK-Documentation/using-variables-as-code.mdx
index 825d6670..92557cc0 100644
--- a/docs/APIs-and-SDKs/SDK-Documentation/Advanced/code-as-a-variant-variable.mdx
+++ b/docs/APIs-and-SDKs/SDK-Documentation/using-variables-as-code.mdx
@@ -1,16 +1,28 @@
+---
+sidebar_position: 8
+---
+
import Image from "@theme/IdealImage";
-# Code as a Variant Variable
+# Using Variables as Code
+
+[Treatment variables](./running-your-first-experiment#step-2-use-variables-for-flexible-experiments)
+are great for setting values like colours, copy, or feature flags. But sometimes you
+want the Web Console to control actual behaviour: injecting HTML elements, running
+functions, or applying CSS styles.
-[Variant Variables](/docs/APIs-and-SDKs/SDK-Documentation/basic-usage#treatment-variables)
-are incredibly useful for setting particular values in your experiments, but
-sometimes it can be useful to run code as a variable instead. This section
-will show you a few examples of how this can be implemented; connecting your
-code and the web console.
+This is useful when your marketing or product team wants to iterate on experiments
+without waiting for a code deploy. They can change the HTML, tweak the CSS, or swap out
+a function directly from the Web Console.
## Starting Point
-For our examples, we will be using a basic Vite app with the following code in our `main.ts` file:
+For these examples, we're using a basic Vite app with the SDK already initialised and a
+context ready (see [Getting Started](./getting-started) if you need to set that up).
+The page starts with a simple heading:
+
+
+Full starting main.ts file
```ts
import absmartly from "@absmartly/javascript-sdk"
@@ -23,8 +35,6 @@ const sdk = new absmartly.SDK({
application: "web"
})
-// NOTE: In production, this should be linked to your users' actual user_id.
-// This is for demonstration purposes.
const request = {
units: {
user_id: Math.floor(Math.random() * 1000000).toString(),
@@ -40,6 +50,8 @@ document.querySelector('#app')!.innerHTML = `
`
```
+
+
Which looks like this:
-We can now access this variant variable in our code to display the heading to
+We can now access this variant variable in our code to display the heading to
the correct audience.
:::info
In the Javascript SDK, variant variables can be accessed with the `context.variableValue("VARIABLE_NAME", defaultValue)` method.
:::
-The simplest way to implement this with JS would be to use the innerHTML
+The simplest way to implement this with JS would be to use the innerHTML
property of a DOM element in our code.
In our base `main.ts` file, we can add the following code:
@@ -80,8 +92,8 @@ context.ready().then(() => {
});
```
-This code makes it so that users in the **Control Variant** see a red `Hello World!`,
-and users in **Variant B** will see a blue one:
+This code makes it so that users in **Variant A** (control) see a red `Hello World!`,
+and users in **Variant B** (variant `1`) will see a blue one:
` tags execute arbitrary code from the
+Web Console. This is equivalent to `eval()`. Before using this pattern:
+
+- **Trust your Web Console administrators.** Anyone who can edit variant variables can
+ execute Javascript in your users' browsers.
+- **Content Security Policy (CSP).** If your site uses a CSP, `new Function()` and
+ inline scripts will be blocked unless you explicitly allow `unsafe-eval` and
+ `unsafe-inline`. Consider whether weakening your CSP is acceptable.
+- **Prefer treatment variables for values.** If you only need to change colours, copy,
+ or feature flags, use `variableValue()` with string/number values instead of
+ executable code. Reserve code injection for cases where you genuinely need dynamic
+ behaviour controlled from the Web Console.
+:::
Let's create a new experiment and add an alert function to **Variant B**.
@@ -105,21 +134,19 @@ Let's create a new experiment and add an alert function to **Variant B**.
alt='A screen capture of the absmartly web console variants section where an alert function has been added as a variant variable to variant B'
/>
-Now, we can add more code to our `main.ts` file to run the function variable
+Now, we can add more code to our `main.ts` file to run the function variable
as code when the context is ready:
```ts
context.ready().then(() => {
const code = context.variableValue("function", '');
- const F = new Function(code); // Turning the string into a function
- window.onload = F(); // Executing the function on page load
-
+ const F = new Function(code);
+ F();
});
```
-You also could add a `