Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Niko/react native template update #548

Merged
merged 27 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f0c924d
Updating versions and lock
nikomancy Dec 5, 2024
cbcc809
Updating mdx-js dep
nikomancy Dec 5, 2024
d85d6ca
Fixing prismjs theme import.
nikomancy Dec 5, 2024
573235b
Updating package, lock, and config for 3.x Katex support.
nikomancy Dec 5, 2024
8191af9
Changing SDK docs over to mdx and correcting 3.x upgrade breaking cha…
nikomancy Dec 5, 2024
5f5078a
Fixing more 3.x update breaking changess.
nikomancy Dec 5, 2024
c4c38fe
Last couple of new MDX syntax errors from 3.x upgrade.
nikomancy Dec 5, 2024
415dae4
Fixing broken links.
nikomancy Dec 5, 2024
a2abf18
Link fix
nikomancy Dec 5, 2024
26bfa82
add precomputed assignments documentation for JS client (#541)
leoromanovsky Dec 5, 2024
17705de
typo subject attributes
leoromanovsky Dec 5, 2024
3d4b060
Update precomputed-assignments.mdx evaluation example (#544)
leoromanovsky Dec 6, 2024
0ebd6dc
Merge branch 'main' into niko/upgrade-docusaurus2-to-docusaurus3
nikomancy Dec 7, 2024
c86656c
Fixing MDX syntax issue.
nikomancy Dec 7, 2024
ad16f7b
React Native updated to match new standard template for docs.
nikomancy Dec 10, 2024
064acb9
fixing broken link.
nikomancy Dec 10, 2024
900c542
Not sure why I included bandits here. Removing content about them as …
nikomancy Dec 20, 2024
1ca06bd
* Deleting old docs
nikomancy Jan 15, 2025
2a33153
* Putting the correct links in the correct places.
nikomancy Jan 15, 2025
57a3231
Intro fixes.
nikomancy Jan 15, 2025
09b8316
* Update to include IAssignmentLogger definition
nikomancy Jan 16, 2025
233cb79
Fixing intro so that the content at the end refers to react native.
nikomancy Jan 16, 2025
f9a2528
* Clarify "Eppo Provided"
nikomancy Jan 16, 2025
831b8d6
* Removing note on local storage
nikomancy Jan 16, 2025
980aaa7
* removing superfluous line of code in a sample.
nikomancy Jan 16, 2025
689032e
Merge branch 'main' into niko/react-native-template-update
nikomancy Jan 16, 2025
57887be
Merge branch 'main' into niko/react-native-template-update
nikomancy Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/data-management/metrics/simple-metric.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ where fact_timestamp >= assignment_timestamp + X days
and assignment_timestamp < current_date - X days
```

Additionally, a maximum number of days (Y) can be set on the retention period by enabling "add a timeframe to aggregate". When this is enabled, the aggregation will include events by subjects after the minimum number of days defined by the retention period (>=X) and before the max timeframe to aggregate (<Y).
Additionally, a maximum number of days (Y) can be set on the retention period by enabling "add a timeframe to aggregate". When this is enabled, the aggregation will include events by subjects after the minimum number of days defined by the retention period (>=X) and before the max timeframe to aggregate (`<Y`).


#### Conversion

Conversion metrics measure the proportion of entities with at least one fact event within a fixed number of days (X) from experiment assignment. For example, a 7-day conversion metric would measure the proportion of users who sign up for a free trial within 7 days of being assigned to the experiment.
Conversion metrics measure the proportion of entities with at least one fact event within a fixed number of days (`X`) from experiment assignment. For example, a 7-day conversion metric would measure the proportion of users who sign up for a free trial within 7 days of being assigned to the experiment.

$\frac{\text{Number of entities with a non-NULL fact within X days}}{\text{Number of unique entities assigned}}$

Expand Down
2 changes: 1 addition & 1 deletion docs/feature-flagging/concepts/audiences.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Audiences allow you to easily define reusable targeting criteria such that you d
![Audience page](/img/feature-flagging/audiences/audience-overview.png)

## Creating an Audience
In the Configuration section, click the "Create" button and select "Audience". Input a title, description (optional), and the [targeting rules](/feature-flagging/concepts/targeting.md).
In the Configuration section, click the "Create" button and select "Audience". Input a title, description (optional), and the [targeting rules](/feature-flagging/concepts/targeting).

![Creating an Audience](/img/feature-flagging/audiences/create-audience.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Each rule may have multiple conditions. The rule is only satisfied if all the co

| Operator | Attribute Type | Meaning |
| :----------------------------------------------------------------------------------------- | :---------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| greater than (>), less than (<), greater than or equal to (>=), less than or equal to (<=) | number, SemVer | Numeric comparison |
| greater than (`>`), less than (`<`), greater than or equal to (`>=`), less than or equal to (`<=`) | number, SemVer | Numeric comparison |
| matches regex | string | Regular expression match |
| one of / not one of | string, number, boolean | Is one of (or not one of) an array of strings. Non-string inputs (number and boolean) are cast to string before performing the comparison. Comparisons are case-sensitive. |

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/marketing/integrating-with-shopify.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ You can use JavaScript to initialize the SDK and check the status of the feature
- Replace `"<YOUR-SDK-KEY>"` with the [SDK key](/sdks/sdk-keys/) you created in Eppo.
- Replace `"<YOUR-FLAG-KEY>"` with the specific [flag key](/feature-flag-quickstart/#create-a-flag) you configured in Eppo for the feature.
- Replace `"<YOUR-SUBJECT-KEY>"` with the id you are using to randomize users. This can be a cookie id, device id, or an id from your analytics platform such as Heap or Rudderstack to name a few. We encourage our customers to keep this id consistent to ensure that bucketing remains consistent. If you will randomizing users who are logged out, see our guidance here on [Subject Keys in a Pre-Authenticated Experiment](/guides/engineering/preauth-experiments/).
- The Eppo client stores your flag configuration locally; it remains available for as many calls, flags and users as you need. You can refresh the cached configuration as often as you need to update flags by setting the `intervalmaxCacheAgeSeconds`. Shopify Classic is not a single-page app. You do not need to re-instantiate the client for every page, but by refreshing the local client, you keep each new page load up-to-date with your configuration. In this example we have arbitrarily set `intervalmaxCacheAgeSeconds` to `180` seconds, which will wait 180 seconds before refreshing the Eppo configuration from our CDN. Feel free to update this interval whatever time frame makes sense for your use case. Read more about the advanced initialization options [here](/sdks/client-sdks/javascript/initialization).
- The Eppo client stores your flag configuration locally; it remains available for as many calls, flags and users as you need. You can refresh the cached configuration as often as you need to update flags by setting the `intervalmaxCacheAgeSeconds`. Shopify Classic is not a single-page app. You do not need to re-instantiate the client for every page, but by refreshing the local client, you keep each new page load up-to-date with your configuration. In this example we have arbitrarily set `intervalmaxCacheAgeSeconds` to `180` seconds, which will wait 180 seconds before refreshing the Eppo configuration from our CDN. Feel free to update this interval whatever time frame makes sense for your use case. Read more about the advanced initialization options [here](/sdks/client-sdks/javascript/Initialization).

### **Shopify Hydrogen (React-Based Storefront)**

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/migrations/optimizely-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
});
```

*[Eppo](/sdks/client-sdks/javascript/initialization):*
*[Eppo](/sdks/client-sdks/javascript/Initialization):*

```tsx
await init({
Expand Down
16 changes: 0 additions & 16 deletions docs/reference/webhook.md

This file was deleted.

88 changes: 88 additions & 0 deletions docs/reference/webhook.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Experiment Update Webhook

Webhooks let your integrations take action in response to events that occur in Eppo. The Experiment Update Webhook is a good solution when a custom application needs to display or take action on the most up to date state of an experiment.

## Webhook Events
The webhook sends four types of experiment update events. If you only want to take action based on certain types of events, you can filter to just the events you are interested in subscribing to based on their event type in the request body.

### Experiment Metric Updated
**Triggers when:**
- Metric is added or removed
- Metric collection is added or removed

**Request body:**

```json
{
"event": "experiment.metric.updated",
"data": {
"experiment_id": "<experiment_id>",
"experiment_key": "<experiment_key>"
},
"signature": "<signature>"
}
```

### Experiment Configuration Updated
**Triggers when:**
- User edits any configuration

**Request body:**

```json
{
"event": "experiment.configuration.updated",
"data": {
"experiment_id": "<experiment_id>",
"experiment_key": "<experiment_key>"
},
"signature": "<signature>"
}
```

### Experiment Status Updated
**Triggers when:**
- Experiment's status changes

**Request body:**

```json
{
"event": "experiment.status.updated",
"data": {
"experiment_id": "<experiment_id>",
"experiment_key": "<experiment_key>"
},
"signature": "<signature>"
}
```

### Experiment Calculated Metrics Updated
**Triggers when:**
- Data pipeline run irrespective of success or failure and mode of trigger manual or scheduled


**Request body:**

```json
{
"event": "experiment.calculated_metrics.updated",
"data": {
"experiment_id": "<experiment_id>",
"experiment_key": "<experiment_key>",
"meta_data": {
"status": "<success | failure>",
"is_manual_refresh": "<boolean>",
"is_data_updated": "<boolean>",
"time_taken_seconds": "<number>",
"is_traffic_imbalance": "<boolean>",
"assignments_scan_start_date": "<date>",
"assignments_scan_end_date": "<date>"
}
},
"signature": "<signature>"
}
```

## Configuring the webhook
To use the webhook, you first need to setup a URL on your side to receive the webhook payload. Once that is done, contact [Eppo support](emailto:[email protected]) to set and enable the webhook.
2 changes: 0 additions & 2 deletions docs/sdks/client-sdks/javascript/Initialization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ The Eppo JavaScript SDK is easy to initialize while offering robust customizatio
To complete basic initialization, you only need to provide an SDK key which you can created in the Eppo UI under **Configuration** > **Environments** > **API Keys**.

```javascript
import * as EppoSdk from "@eppo/js-client-sdk";

import { init } from "@eppo/js-client-sdk";

await init({
Expand Down
4 changes: 2 additions & 2 deletions docs/sdks/client-sdks/javascript/bandits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ The SDK will invoke the `logBanditAction()` function with an `IBanditEvent` obje
| `actionProbability` (number) | The weight between 0 and 1 the bandit valued the assigned action | 0.25 |
| `optimalityGap` (number) | The difference between the score of the selected action and the highest-scored action | 456 |
| `modelVersion` (string) | Unique identifier for the version (iteration) of the bandit parameters used to determine the action probability | "v123" |
| `metaData` Record<string, unknown> | Any additional freeform meta data, such as the version of the SDK | `{ "sdkLibVersion": "3.5.1" }` |
| `metaData` Record\<string, unknown\> | Any additional freeform meta data, such as the version of the SDK | `{ "sdkLibVersion": "3.5.1" }` |

### Querying the bandit for an action

To query the bandit for an action, you can use the `getBanditAction()` function. This function takes the following parameters:
- `flagKey` (string): The key of the feature flag corresponding to the bandit
- `subjectKey` (string): The key of the subject or user assigned to the experiment variation
- `subjectAttributes` (Attributes | ContextAttributes): The context of the subject
- `actions` (string[] | Record<string, Attributes | ContextAttributes>): Available actions, optionally mapped to their respective contexts
- `actions` (string\[\] | Record\<string, Attributes | ContextAttributes\>): Available actions, optionally mapped to their respective contexts
- `defaultValue` (string): The default *variation* to return if the flag is not successfully evaluated

:::note
Expand Down
4 changes: 2 additions & 2 deletions docs/sdks/client-sdks/javascript/nextjs-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ offlineInit({

This function is synchronous and ready to handle assignments after it returns.

Additional details are available in the [offline initialization documentation](/sdks/client-sdks/javascript/initialization#offline-initialization) for the client SDK.
Additional details are available in the [offline initialization documentation](/sdks/client-sdks/javascript/Initialization#offline-initialization) for the client SDK.

## Start a new Next.js React App

Expand Down Expand Up @@ -77,7 +77,7 @@ Open a browser to the location output for `local` (e.g., [http://localhost:3000]
## Eppo flag setup

1. [Create and copy an SDK key](/sdks/sdk-keys.md) in your Eppo app if you don't already have one.
2. [Create a feature flag](/quick-starts/feature-flag-quickstart.md/#2-create-a-flag) in your Eppo app.
2. [Create a feature flag](/feature-flag-quickstart#create-a-flag) in your Eppo app.
3. Make sure your flag is turned on in the environment that correlates to your SDK key.

## Client rendered component setup
Expand Down
2 changes: 1 addition & 1 deletion docs/sdks/client-sdks/javascript/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ For full steps to create a bandit including UI steps, see the [bandit quickstart
Now that you've seen how to make assignments with the Eppo JavaScript SDK, we strongly recommend familiarizing yourself with the following topics:

- [High Level concepts for the client API](/sdks/client-sdks)
- [Initialization Configuration](/sdks/client-sdks/javascript/initialization)
- [Initialization Configuration](/sdks/client-sdks/javascript/Initialization)
- [Assignment details](/sdks/client-sdks/javascript/assignments)
- [Using the SDK with React](/sdks/client-sdks/javascript/react)
- [Using the SDK with Next.js](/sdks/client-sdks/javascript/nextjs-setup) if you are using Next.js
5 changes: 5 additions & 0 deletions docs/sdks/client-sdks/react-native/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "React Native",
nikomancy marked this conversation as resolved.
Show resolved Hide resolved
"position": 5
}

Loading