diff --git a/docs/experiments-plus/create-new.md b/docs/experiments-plus/create-new.md index 1b0d4de08..ebddf6219 100644 --- a/docs/experiments-plus/create-new.md +++ b/docs/experiments-plus/create-new.md @@ -8,6 +8,11 @@ last_update: date: 2025-03-04 --- + +:::tip[Warehouse Native users] +You're viewing the Cloud docs for this page. Metrics and experiments behave differently in Warehouse Native. Read about [Configuring Experiments in Warehouse Native](/statsig-warehouse-native/features/experiment-options). +::: + This guide walks you through the steps to create and configure a new experiment in Statsig. Whether you're running a simple A/B test or a more complex multi-variant experiment, these instructions will help you set up your experiment correctly. ### User-level Experiments diff --git a/docs/experiments-plus/differential-impact-detection-whn.md b/docs/experiments-plus/differential-impact-detection-whn.md new file mode 100644 index 000000000..6eb864037 --- /dev/null +++ b/docs/experiments-plus/differential-impact-detection-whn.md @@ -0,0 +1,13 @@ +--- +title: Differential Impact Detection +sidebar_label: Differential Impact +slug: /experiments-plus/differential-impact-detection-whn +keywords: + - owner:vm +last_update: + date: 2025-01-30 +--- + +import DifferentialImpact from '@site/docs/experiments-plus/differential-impact-detection.md'; + + \ No newline at end of file diff --git a/docs/experiments-plus/introduction.md b/docs/experiments-plus/introduction.md index 25d325bb1..271e95d86 100644 --- a/docs/experiments-plus/introduction.md +++ b/docs/experiments-plus/introduction.md @@ -22,8 +22,6 @@ Experiments are ideal when you want to: - Run mutually exclusive experiments in parallel. - Measure the direct impact of changes on product and business metrics. -For a deeper understanding of using experiments in Statsig, see "[Experiments Overview](/experiments-plus)" section. - --- ## Why Experiment? diff --git a/docs/experiments-plus/stratified-sampling-whn.md b/docs/experiments-plus/stratified-sampling-whn.md new file mode 100644 index 000000000..4a77e4881 --- /dev/null +++ b/docs/experiments-plus/stratified-sampling-whn.md @@ -0,0 +1,13 @@ +--- +title: Stratified Sampling +sidebar_label: Stratified Sampling +slug: /experiments-plus/stratified-sampling-whn +keywords: + - owner:vm +last_update: + date: 2024-10-02 +--- + +import StratifiedSampling from '@site/docs/experiments-plus/stratified-sampling.md'; + + \ No newline at end of file diff --git a/docs/experiments/meta-analysis-whn.mdx b/docs/experiments/meta-analysis-whn.mdx new file mode 100644 index 000000000..92f87c73a --- /dev/null +++ b/docs/experiments/meta-analysis-whn.mdx @@ -0,0 +1,13 @@ +--- +title: Meta-Analysis +sidebar_label: Meta-Analysis +slug: /experimentation/meta-analysis-whn +keywords: + - owner:vm +last_update: + date: 2025-03-17 +--- + +import MetaAnalysis from "@site/docs/experiments/meta-analysis.md" + + diff --git a/docs/experiments/quality-score-whn.mdx b/docs/experiments/quality-score-whn.mdx new file mode 100644 index 000000000..b26cab195 --- /dev/null +++ b/docs/experiments/quality-score-whn.mdx @@ -0,0 +1,13 @@ +--- +title: Experiment Quality Score +sidebar_label: Quality Score +slug: /experimentation/quality-score-whn +keywords: + - owner:vm +last_update: + date: 2025-02-14 +--- + +import QualityScore from '@site/docs/experiments/quality-score.mdx'; + + diff --git a/docs/experiments/quality-score.md b/docs/experiments/quality-score.mdx similarity index 99% rename from docs/experiments/quality-score.md rename to docs/experiments/quality-score.mdx index e175e2fde..dce152e70 100644 --- a/docs/experiments/quality-score.md +++ b/docs/experiments/quality-score.mdx @@ -19,3 +19,4 @@ You can enable it in Settings -> Experimentation -> Experiment Quality Score. Th ## Viewing it When enabled, you can view the experiment quality score on any experiment. Applicable checks will be evaluated. ![image](https://github.com/user-attachments/assets/d7483b96-8077-419d-9e23-a3e648b7e066) + diff --git a/docs/getting-started.mdx b/docs/getting-started.mdx index f4189480b..a16d0f2c2 100644 --- a/docs/getting-started.mdx +++ b/docs/getting-started.mdx @@ -11,30 +11,75 @@ import SDKAndFrameworks from '../src/components/getting-started/SDKAndFrameworks import ImportantConcepts from '../src/components/getting-started/ImportantConcepts'; import Styles from '../src/components/getting-started/Styles'; import LandingResources from '../src/components/getting-started/Resources'; +import React from 'react'; +import Card from '@site/src/components/Card'; +import CardHeader from '@site/src/components/Card/CardHeader'; +import CardBody from '@site/src/components/Card/CardBody'; +import CardFooter from '@site/src/components/Card/CardFooter'; +import Columns from '@site/src/components/Columns'; +import Column from '@site/src/components/Columns/Column'; +import Link from '@docusaurus/Link'; # Welcome to Statsig Documentation -Statsig is the complete platform for product growth, empowering your team to build and innovate like the best tech companies in the world. - - -You can use Statsig’s products directly with your own data warehouse through [Warehouse Native](/statsig-warehouse-native/introduction). This allows you to leverage Statsig’s features while keeping data in your existing infrastructure. +Statsig empowers you to ship, measure, and learn from your releases using the same tools as the best tech companies in the world. With Statsig, you can run thousands of A/B tests, safely rollout features, and dive deep on core business metrics and user behavior—all on a single, unified platform. + +
+ + + + Flash Icon +

SDK Quickstart

+

Install the Statsig SDK and get started in minutes.

+
+ + + + + +
+
+ + + + + Organization Icon +

Warehouse Native

+

Read about how to use Statsig with your data warehouse.

+
+ + + + + +
+
+ + + + + Description Icon +

Intro to Statsig

+

Learn more about core concepts and features of Statsig.

+
+ + + + + +
+
+
+--- -## Getting Started with Statsig -Statsig supports over **30 SDKs and frameworks**, allowing you to quickly integrate with your application, whether you’re building for the web, mobile, or server environments. Follow these simple steps to get started in minutes: -## Add Statsig to Your Website (JavaScript Snippet) -The easiest way to get up and running is by adding the Statsig JavaScript snippet to your website. This setup takes just a few seconds: +## Key Features -Paste the following code into the `` section of your website, replacing `"YOUR_CLIENT_KEY"` with your project’s **Client API Key**, which you can find in the [Statsig Console](https://console.statsig.com/api_keys). + -```html - -``` +You can use Statsig's products directly with your own data warehouse through [Warehouse Native](/statsig-warehouse-native/introduction). This allows you to leverage Statsig's features while keeping data in your existing infrastructure. -Once installed, you’ll be able to: -- Start **recording events**. -- Use **session replays**. -- Leverage Statsig’s **experiments** and **feature flags** right away. +--- ## Explore SDKs @@ -42,14 +87,11 @@ For greater control, Statsig offers SDKs for a wide variety of platforms, includ -- If you don’t see the SDK or framework you need, feel free to reach out directly in our [Slack Community](https://statsig.com/slack). +If you don't see the SDK or framework you need, feel free to reach out directly in our [Slack Community](https://statsig.com/slack). --- - -## Learn More and Get Help - -Resources to help you make the most of Statsig: - +# Learning Resources +- **Videos**: Check out our full library of [Statsig Onboarding Training Videos](https://www.youtube.com/playlist?list=PLNJ9pKAaib3J0fYyCYRX3JhtSpwtiEL0Q) on Youtube. - **Community**: Join our [Slack Community](https://statsig.com/slack) to connect with other users and get help from the Statsig team. - **Blog**: Stay updated with the latest developments in product experimentation and feature management on our [Blog](https://statsig.com/blog). diff --git a/docs/guides/abn-tests.mdx b/docs/guides/abn-tests.mdx index 53cea3c4a..9b7fc7b84 100644 --- a/docs/guides/abn-tests.mdx +++ b/docs/guides/abn-tests.mdx @@ -1,5 +1,5 @@ --- -sidebar_label: Your First A/B Test +sidebar_label: Run your first Experiment title: Your First A/B Test keywords: - owner:vm diff --git a/docs/guides/feature-gates-walkthrough.md b/docs/guides/feature-gates-walkthrough.md new file mode 100644 index 000000000..ca347475f --- /dev/null +++ b/docs/guides/feature-gates-walkthrough.md @@ -0,0 +1,121 @@ +--- +sidebar_label: Create your first Feature Gate +title: Create your first Feature Gate +slug: guides/feature-gates +keywords: + - owner:jinayoon +last_update: + date: 2025-04-28 +--- + +This tutorial walks you through how to create your first Feature Gate in Statsig from end to end. Feature Gates, also known as feature flags, are a way to safely control the rollout of new features to your users without deploying additional code. Common examples for using Feature Gates include shipping new UI elements, API endpoints, or product features. + +By the end of this tutorial, you will have set up: +* A **Feature Gate** in the Statsig console +* A **targeting rule** to enable the feature for a segment of Users +* A **client-side integration** using the Statsig Client SDK + + +## Prerequisites +1. A [Statsig account](https://console.statsig.com/sign_up) +2. An existing application you can integrate the Statsig Client SDK into + +## Part 1: Create a Feature Gate in the console +For the purposes of this tutorial, we will pretend we are adding a Feature Gate to deploy a new UI element to a user with the "statsig.com" email domain. You can follow along with a specific feature if you have your own scenario in mind. + +1. Navigate to [Feature Gates](https://console.statsig.com/gates) in the Statsig console. + +![Feature Gates Page](https://github.com/user-attachments/assets/00331234-34b7-48ef-98a9-9a094e44af1b) + +2. Then, click on **Get Started** if you don't have any Feature Gates set up yet, or **Create** to create a new one. + +3. Name your gate "Example Gate". This name will also be used to identify the Feature Gate later using the SDK. + +4. Enter a description for your Feature Gate. It's good practice to describe it in a way that other teammates can easily understand. For example: "This Feature Gate is for launching an example feature for Statsig employees only." + + +## Part 2: Configure targeting rules +In Statsig, when you create a Feature Gate, they are enabled by default. In other words, all users will be excluded from the feature until you add a rule that lets users "pass" the gate. + +This means that in order to actually turn on this feature, you will need to add rules to target this Feature Gate to a specific set of folks. Let's walk through doing this in the console. + +1. In the console, on the page for the Feature Gate you just created, click on **Add New Rule**. + +![Adding a new rule](https://github.com/user-attachments/assets/f4717e74-c1a7-4e3e-b894-13622f230f71) + +2. Give this rule a **Name**, such as "Statsig Users Only". + +3. Select **Email** as our targeting criteria so we can target users based on their email address. + +4. In the User section of the dropdown, select the **Any Of (Case Insensitive)** operator, and then add ``statsig.com`` for our email-based user targeting. + +5. Set the **Pass Percentage** to ``100%``. Doing so ensures that all users with the ``statsig.com`` email domain will pass the Feature Gate and see the new feature. + +6. Click **Add Rule** to add this rule to your Feature Gate. + +7. Next, hit **Save** on the bottom right to commit these changes to the Feature Gate. + +You can now test this feature gate by configuring the User object in the "Test Gate" section. + +## Part 3: Create a Client API Key +Now that you've set up the Feature Gate from the console, it's time to integrate it into your product with the Statsig SDK. We'll first need to create a new Client API key to use in our product. + +1. Navigate to [**Keys & Environments**](https://console.statsig.com/api_keys) in the Statsig console. You can also find this by going to **Settings** at the bottom left of the Statsig console. + +2. Scroll down to **API Keys**. Click on **Generate New Key**. + +3. In the dropdown, select **Client**. + +4. Copy the Client API Key you just created to your clipboard. + +## Part 4: Integrate the Statsig SDK +Now that we have our Client API Key, we can go ahead and integrate the Statsig Client SDK into our product. For the purposes of this tutorial, we will use the React SDK, but you can follow along with a different SDK if you prefer. + +:::tip +Statsig offers over 20 client and server-side SDKs. Check out the full list of [SDKs](/sdks/client-vs-server#available-sdks) to find the one that best fits your needs. +::: + +1. Install the Statsig React SDK using your preferred package manager. For this tutorial, we will use npm. + +```bash +npm install @statsig/react +``` + +2. Import the SDK in your `App.js` file: + +```tsx +import { StatsigProvider } from "@statsig/react-bindings"; +``` + +3. Next, wrap your app's content within the `StatsigProvider` component. In the following code snippet, we're also creating a [User](/concepts/user) object so that we can target our Feature Gate. + + +```tsx +function App() { + return ( + +
Hello world
+
+ ); +} + +export default App; +``` + +4. Make sure to also replace `client-KEY` with the Client API Key you copied in Step 3. + +## Part 5: Check your Feature Gate +Finally, you can now evaluate a Feature Gate in your product code by getting the client with the `useStatsigClient` hook, and then calling `checkGate`. + +1. Add the following code to your `App.js` file. In this snippet, the `example_gate` is the name of the Feature Gate you created in Step 1. + +```tsx +const { client } = useStatsigClient(); +return ( +
Gate is {client.checkGate('check_user') ? 'passing' : 'failing'}.
+); +``` + +2. Run your app and see the result! The app should render the text "Gate is passing" since we configured a rule in Part 1 that targets all users with the ``statsig.com`` email domain, and we are using that same email domain in this client's User object. \ No newline at end of file diff --git a/docs/guides/first-feature.mdx b/docs/guides/first-feature.mdx index b06701ec9..830e1b457 100644 --- a/docs/guides/first-feature.mdx +++ b/docs/guides/first-feature.mdx @@ -194,4 +194,4 @@ if (client.checkGate("mobile_registration")) { } ``` -## Happy Feature Gating! +## Happy Feature Gating! \ No newline at end of file diff --git a/docs/guides/logging-events.mdx b/docs/guides/logging-events.mdx index a9f3be52a..355a8c000 100644 --- a/docs/guides/logging-events.mdx +++ b/docs/guides/logging-events.mdx @@ -1,5 +1,5 @@ --- -sidebar_label: Logging Events +sidebar_label: Log your first Custom Event title: Logging Events & the LogEvent API keywords: - owner:brock diff --git a/docs/insights/aggregated-impact-whn.md b/docs/insights/aggregated-impact-whn.md new file mode 100644 index 000000000..8ba86d7eb --- /dev/null +++ b/docs/insights/aggregated-impact-whn.md @@ -0,0 +1,13 @@ +--- +title: Metric Insights and Aggregated Impact +sidebar_label: Aggregated Impact +slug: /aggregated-impact-whn +keywords: + - owner:vm +last_update: + date: 2025-03-18 +--- + +import AggregatedImpact from '@site/docs/insights/aggregated-impact.md'; + + \ No newline at end of file diff --git a/docs/metrics/101.md b/docs/metrics/101.md index 7a0383c40..20dc23a70 100644 --- a/docs/metrics/101.md +++ b/docs/metrics/101.md @@ -10,6 +10,11 @@ last_update: # Metrics Overview + +:::tip[Warehouse Native users] +You're viewing the Cloud docs for this page. Metrics and experiments behave differently in Warehouse Native. Read more in [Data & Semantic Layer in Warehouse Native](/statsig-warehouse-native/configuration/data-and-semantic-layer). +::: + This 101-level user guide steps through the basic concepts to help you set up essential product metrics in your Statsig Project. 1. [How Metrics Work on Statsig](/metrics/how-metrics-work) 2. [Raw Events](/metrics/raw-events) diff --git a/docs/metrics/how-metrics-work.md b/docs/metrics/how-metrics-work.md index 19c5916da..b166841ac 100644 --- a/docs/metrics/how-metrics-work.md +++ b/docs/metrics/how-metrics-work.md @@ -10,6 +10,10 @@ last_update: # How Metrics Work on Statsig +:::tip[Warehouse Native users] +You're viewing the Cloud docs for this page. Metrics and experiments behave differently in Warehouse Native. Read more in [Data & Semantic Layer in Warehouse Native](/statsig-warehouse-native/configuration/data-and-semantic-layer). +::: + A metric in Statsig is a numeric value for each user on a given day. This value can be aggregated across the entire user base or a subset, such as the test or control group of an experiment. For example, say one user made two purchases on September 1st, and another made only one. These values can be aggregated across multiple users to calculate the total number of purchases across all users on September 1st. diff --git a/docs/pulse/access-whn.md b/docs/pulse/access-whn.md new file mode 100644 index 000000000..4db8f68d9 --- /dev/null +++ b/docs/pulse/access-whn.md @@ -0,0 +1,153 @@ +--- +title: Access Pulse Reports in Warehouse Native +sidebar_label: Access Pulse Reports +slug: /pulse/access-whn +keywords: + - owner:vm +last_update: + date: 2025-03-05 +--- + + +## How to Access Pulse Data in Warehouse Native + +WHN lets you access exposures and metric results across all experiments directly in your warehouse through SQL Views defined in your Statsig project through a metric source. + +### Exposures +Exposures are automatically written to your warehouse to the table configured in your project setup. You can find the table's location by going to Settings > Data Connection. The table should be located at the `{Database Name}.{Schema Name}.{Exposures Forwarding Table Name}`, e.g. `experimentation.statsig.exposures`. + +### Results +With a SQL View, you have access to values that include experiment metadata like experiment team, experiment tags, target duration, and experiment settings like CUPED and Sequential testing, then each metric’s metadata like metric tags, and all of the metric lifts-same set of results you see on the Console copy. If you want to start using this feature, simply enable it in your project setting Project Settings > Data Connection > Export. Once you have this enabled, we will automatically handle the setup of SQL view in your warehouse as well as the metric source in your Statsig project. We will then automatically export scorecard metric results to your data warehouse each time an experiment is loaded. + +![image](https://github.com/user-attachments/assets/0355e284-7e3f-40db-b441-fa2a00ccf3ab) + + +### Schema of the Results Data Export Table +The default table name used is statsig_daily_results. When exports are enabled, Statsig also autocreates a metric source with this name in your Statsig project. + +| Column | Type | Description | +|-|-|-| +| ds | date | The date when the data was recorded | +| experimentName | string | Name of the experiment | +| experimentCreator | string | Creator of the experiment | +| experimentTeam | string | Team conducting the experiment | +| experimentTags | array of strings | Tags associated with the experiment, represented as an array of strings | +| experimentStartTs | number | Start timestamp of the experiment, in milliseconds | +| experimentEndTs | number | End timestamp of the experiment, in milliseconds | +| targetExposures | number | The target number of exposures for the experiment | +| targetDuration | number | The target duration of the experiment | +| actualDuration | number | The actual duration the experiment ran | +| controlGroupName | string | Name of the control group in the experiment | +| testGroupName | string | Name of the test group in the experiment | +| useCUPED | boolean | Whether CUPED was applied in the experiment | +| useSequential | boolean | Whether sequential testing was applied in the experiment | +| metricName | string | Name of the metric being measured in the experiment | +| metricType | string | Type of metric | +| metricTags | array of strings | Tags associated with the metric, represented as an array of strings | +| higherIsBetter | boolean | Whether a higher value of the metric is better | +| isVerifiedMetric | boolean | Whether the metric is verified | +| metricTeam | string | Team responsible for the metric | +| absoluteDelta | number | The absolute change in the metric value between control and test groups | +| absoluteDeltaCI | number | Confidence interval for the absolute delta | +| relativeDelta | number | The relative change in the metric value between control and test groups | +| relativeDeltaCI | number | Confidence interval for the relative delta | +| absoluteDeltaPValue | number | P-value associated with the absolute delta metric result | +| toplineAbs | number | The absolute topline metric value for the experiment | +| toplineAbsCI | number | Confidence interval for the absolute topline metric | +| toplineRel | number | The relative topline metric value for the experiment | +| toplineRelCI | number | Confidence interval for the relative topline metric | +| projectedTopline | number | Projected topline metric value based on current data | +| projectedToplineCI | number | Confidence interval for the projected topline metric | +| projectedToplineRel | number | Projected relative topline metric value based on current data | +| projectedToplineRelCI | number | Confidence interval for the projected relative topline metric | +| controlUnits | number | The number of control group units | +| testUnits | number | The number of test group units | +| controlTotal | number | Total value for the control group metric | +| testTotal | number | Total value for the test group metric | +| controlMean | number | The mean value for the control group | +| testMean | number | The mean value for the test group | +| sequentialTestingAbsoluteDeltaCI | number (optional) | Confidence interval for the absolute delta with sequential testing enabled| +| sequentialTestingRelativeDeltaCI | number (optional) | Confidence interval for the relative delta with sequential testing enabled| +| sequentialTestingAbsoluteDeltaPValue | number (optional) | P-value for the absolute delta with sequential testing enabled| + + +## Report Types + +There are three types of exports: + +1. Exposures - A table of all exposed users and their first exposures. This is useful for joining on your own internal data, and running custom queries within your own data warehouse. This can also be used to verify who was in the experiment, what group they were assigned to, and when they were first exposed (around 1-25MB). This will contain: + 1. `_first_exposures.csv` - contains a list of users and their first exposure to the experiment. +2. Pulse Summary - This provides precomputed summary experimental data for all metrics and test groups including everything that's visible on Pulse (**around 10-100 kb**). This will contain: + + 1. `_pulse_summary.csv` - contains Pulse aggregate metrics computed over the duration of the experiment. + +3. Raw Data - This provides raw exposures and metrics data at the user-day level. This is best used for manually inspecting data, or recomputing your own statistics (**around 10MB-1GB**). This will contain: + 1. `_first_exposures.csv` - contains a list of users and their first exposure to the experiment. If this is the only file you are interested in, you can get this by exporting an "Exposures" report which will be much smaller in size. + 2. `_user_metrics.csv` - contains a list of experimental users, and their calculated metrics for each day they were enrolled in the experiment. + +In WHN, only the Pulse Summary may be exported, as the other two types of data are only stored [in your warehouse](https://docs.statsig.com/statsig-warehouse-native/pipeline-overview/#artifacts-and-entity-relationships). The availability of these exports are subject to our retention policy. We hold exposures data for up-to 90 days after an experiment is concluded. We hold raw user-level metrics data for 90 days. + +### Pulse Summary File Description - For Feature Gates + +| Column Name | Description | +| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | Name of the Experiment or Feature Gate | +| rule | Name of the Feature Gate Rule. | +| metric_type | Category of the metric. Different metric_types are computed differently, including how they're computed in Pulse. | +| metric_name | The name of the metric. For event metrics, this is the name of the event. | +| metric_dimension | The subcategory of the metric. For example, if you log value in LogEvent, then value will show up as a subdimension. dimension = !statsig_topline indicates that this row reflects an aggregate across all dimensions. | +| start_date | The start date for this measurement | +| end_date | The end date for this measurement | +| test_units | The number of users in the test group | +| test_mean | The average value of this metric across test users (or participating units when applicable) | +| test_stderr | The standard error for the estimate of the mean for test users. This can be used to compute confidence intervals. | +| ctrl_units | The number of users in the control group | +| ctrl_mean | The average value of this metric across control users (or participating units when applicable) | +| ctrl_stderr | The standard error for the estimate of the mean for control users. This can be used to compute confidence intervals. | +| abs_delta | The absolute difference between the test and control mean (test_mean - ctrl_mean) | +| abs_stderr | The estimated standard error of abs_delta | +| rel_delta | The relative difference between test and control mean, sometimes referred to as lift (test_mean - ctrl_mean)/ctrl_mean | +| rel_stderr | The estimated standard error of rel_delta (abs_delta/ctrl_mean) | +| z_score | The calculated Z-score | + +### Pulse Summary File Description - For Experiments + +| Column Name | Description | +| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | Name of the Experiment or Feature Gate | +| rule | Name of the Feature Gate Rule. | +| experiment_group | The group of users for which this metric is computed for. For a feature gate, this is pass/fail. For an experiment, this is the variant name. | +| metric_type | Category of the metric. Different metric_types are computed differently, including how they're computed in Pulse. | +| metric_name | The name of the metric. For event metrics, this is the name of the event. | +| metric_dimension | The subcategory of the metric. For example, if you log value in LogEvent, then value will show up as a subdimension. dimension = !statsig_topline indicates that this row reflects an aggregate across all dimensions. | +| start_date | The start date for this measurement | +| end_date | The end date for this measurement | +| units | The number of users included in this metric estimate. | +| mean | The average value of this metric across units (or participating units when applicable) | +| stderr | The standard error for the estimate of the mean. This can be used to compute confidence intervals. | + +### First Exposures File Description + +| Column Name | Description | +| ----------------------- | --------------------------------------------------------------------------------------------- | +| unit_id | Refers to the unit identifier used in the experiment (eg. user_id, stable_id, org_id) | +| name | The name of the gate/experiment | +| rule | For gates, this refers to the rule name | +| experiment_group | The group the user was assigned to | +| first_exposure_utc | The UTC timestamp when the user was first assigned to the experiment | +| first_exposure_pst_date | The date in PST when the user was first assigned to the experiment | +| as_of_pst_date | The date this data was generated | +| user_dimensions | JSON-formatted key-value pairs describing the user's attributes at the time of first exposure | + +### Unit Metrics File Description + +| Column Name | Description | +| ---------------- | ------------------------------------------------------------------------------------------- | +| pst_ds | The 24hr window the the data refers to. All dates are anchored from 12:00a -> 11:59p PST. | +| unit_id | Refers to the unit identifier used in the experiment (eg. user_id, stable_id, org_id) | +| metric_type | The category of the metric | +| metric_name | The name of the metric | +| metric_dimension | The name of the metric dimension. '!statsig_topline' is the overall metric with no slicing. | +| metric_value | The numeric value of the metric | +| numerator | For some metrics, we track the numerator | +| denominator | For some metrics, we track the denominator | diff --git a/docs/pulse/best-practices-whn.md b/docs/pulse/best-practices-whn.md new file mode 100644 index 000000000..e0580e6d7 --- /dev/null +++ b/docs/pulse/best-practices-whn.md @@ -0,0 +1,13 @@ +--- +title: Best Practices and Avoiding False Positives +sidebar_label: Best Practices +slug: /pulse/best-practices-whn +keywords: + - owner:vm +last_update: + date: 2022-12-20 +--- + +import PulseBestPractices from '@site/docs/pulse/best-practices.md'; + + diff --git a/docs/pulse/custom-queries-whn.md b/docs/pulse/custom-queries-whn.md new file mode 100644 index 000000000..249f1c626 --- /dev/null +++ b/docs/pulse/custom-queries-whn.md @@ -0,0 +1,13 @@ +--- +title: Custom "Explore" Queries +sidebar_label: Custom "Explore" Queries +slug: /pulse/custom-queries-whn +keywords: + - owner:vm +last_update: + date: 2025-02-28 +--- + +import CustomQueries from '@site/docs/pulse/custom-queries.md'; + + diff --git a/docs/pulse/drill-down-whn.md b/docs/pulse/drill-down-whn.md new file mode 100644 index 000000000..84f3cde1d --- /dev/null +++ b/docs/pulse/drill-down-whn.md @@ -0,0 +1,13 @@ +--- +title: Pulse +sidebar_label: Metric Drill-Down +slug: /pulse/drill-down-whn +keywords: + - owner:vm +last_update: + date: 2025-02-06 +--- + +import PulseDrillDown from '@site/docs/pulse/drill-down.mdx'; + + diff --git a/docs/pulse/drill-down.md b/docs/pulse/drill-down.mdx similarity index 100% rename from docs/pulse/drill-down.md rename to docs/pulse/drill-down.mdx diff --git a/docs/pulse/export.md b/docs/pulse/export.md index 1a6102235..fce0a403c 100644 --- a/docs/pulse/export.md +++ b/docs/pulse/export.md @@ -8,10 +8,11 @@ last_update: date: 2025-03-05 --- -## How to Export Pulse Data - Cloud Projects +## How to Export Pulse Data in Statsig Cloud -:::tip -These options apply for Statsig Cloud projects. If your project is a Warehouse Native (WHN) project, see the corresponding section below. + +:::tip[Warehouse Native users] +You're viewing the Cloud docs for this page. Metrics and experiments behave differently in Warehouse Native. Read [How to Access Pulse Data in Warehouse Native](/pulse/access-whn). ::: ![Finding Export Report](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/CbjKvuo40oMU45psWLvG/a2d68701-6828-47d2-8fde-b44a5cea4abb.png) @@ -20,149 +21,3 @@ You can export your Pulse Results for Feature Gates and Experiments. Simply navi ![Export Pulse Report Menu](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/CbjKvuo40oMU45psWLvG/5af19e59-f2b7-492b-9dc2-9439e447dbcc.png) -## How to Access Pulse Data - For Warehouse Native - -:::tip -These options apply for Statsig WHN projects. If your project is a Cloud project, see the corresponding section above. -::: - -WHN lets you access exposures and metric results across all experiments directly in your warehouse through SQL Views defined in your Statsig project through a metric source. - -### Exposures -Exposures are automatically written to your warehouse to the table configured in your project setup. You can find the table's location by going to Settings > Data Connection. The table should be located at the `{Database Name}.{Schema Name}.{Exposures Forwarding Table Name}`, e.g. `experimentation.statsig.exposures`. - -### Results -With a SQL View, you have access to values that include experiment metadata like experiment team, experiment tags, target duration, and experiment settings like CUPED and Sequential testing, then each metric’s metadata like metric tags, and all of the metric lifts-same set of results you see on the Console copy. If you want to start using this feature, simply enable it in your project setting Project Settings > Data Connection > Export. Once you have this enabled, we will automatically handle the setup of SQL view in your warehouse as well as the metric source in your Statsig project. We will then automatically export scorecard metric results to your data warehouse each time an experiment is loaded. - -![image](https://github.com/user-attachments/assets/0355e284-7e3f-40db-b441-fa2a00ccf3ab) - - -### Schema of the Results Data Export Table -The default table name used is statsig_daily_results. When exports are enabled, Statsig also autocreates a metric source with this name in your Statsig project. - -| Column | Type | Description | -|-|-|-| -| ds | date | The date when the data was recorded | -| experimentName | string | Name of the experiment | -| experimentCreator | string | Creator of the experiment | -| experimentTeam | string | Team conducting the experiment | -| experimentTags | array of strings | Tags associated with the experiment, represented as an array of strings | -| experimentStartTs | number | Start timestamp of the experiment, in milliseconds | -| experimentEndTs | number | End timestamp of the experiment, in milliseconds | -| targetExposures | number | The target number of exposures for the experiment | -| targetDuration | number | The target duration of the experiment | -| actualDuration | number | The actual duration the experiment ran | -| controlGroupName | string | Name of the control group in the experiment | -| testGroupName | string | Name of the test group in the experiment | -| useCUPED | boolean | Whether CUPED was applied in the experiment | -| useSequential | boolean | Whether sequential testing was applied in the experiment | -| metricName | string | Name of the metric being measured in the experiment | -| metricType | string | Type of metric | -| metricTags | array of strings | Tags associated with the metric, represented as an array of strings | -| higherIsBetter | boolean | Whether a higher value of the metric is better | -| isVerifiedMetric | boolean | Whether the metric is verified | -| metricTeam | string | Team responsible for the metric | -| absoluteDelta | number | The absolute change in the metric value between control and test groups | -| absoluteDeltaCI | number | Confidence interval for the absolute delta | -| relativeDelta | number | The relative change in the metric value between control and test groups | -| relativeDeltaCI | number | Confidence interval for the relative delta | -| absoluteDeltaPValue | number | P-value associated with the absolute delta metric result | -| toplineAbs | number | The absolute topline metric value for the experiment | -| toplineAbsCI | number | Confidence interval for the absolute topline metric | -| toplineRel | number | The relative topline metric value for the experiment | -| toplineRelCI | number | Confidence interval for the relative topline metric | -| projectedTopline | number | Projected topline metric value based on current data | -| projectedToplineCI | number | Confidence interval for the projected topline metric | -| projectedToplineRel | number | Projected relative topline metric value based on current data | -| projectedToplineRelCI | number | Confidence interval for the projected relative topline metric | -| controlUnits | number | The number of control group units | -| testUnits | number | The number of test group units | -| controlTotal | number | Total value for the control group metric | -| testTotal | number | Total value for the test group metric | -| controlMean | number | The mean value for the control group | -| testMean | number | The mean value for the test group | -| sequentialTestingAbsoluteDeltaCI | number (optional) | Confidence interval for the absolute delta with sequential testing enabled| -| sequentialTestingRelativeDeltaCI | number (optional) | Confidence interval for the relative delta with sequential testing enabled| -| sequentialTestingAbsoluteDeltaPValue | number (optional) | P-value for the absolute delta with sequential testing enabled| - - -## Report Types - -There are three types of exports: - -1. Exposures - A table of all exposed users and their first exposures. This is useful for joining on your own internal data, and running custom queries within your own data warehouse. This can also be used to verify who was in the experiment, what group they were assigned to, and when they were first exposed (around 1-25MB). This will contain: - 1. `_first_exposures.csv` - contains a list of users and their first exposure to the experiment. -2. Pulse Summary - This provides precomputed summary experimental data for all metrics and test groups including everything that's visible on Pulse (**around 10-100 kb**). This will contain: - - 1. `_pulse_summary.csv` - contains Pulse aggregate metrics computed over the duration of the experiment. - -3. Raw Data - This provides raw exposures and metrics data at the user-day level. This is best used for manually inspecting data, or recomputing your own statistics (**around 10MB-1GB**). This will contain: - 1. `_first_exposures.csv` - contains a list of users and their first exposure to the experiment. If this is the only file you are interested in, you can get this by exporting an "Exposures" report which will be much smaller in size. - 2. `_user_metrics.csv` - contains a list of experimental users, and their calculated metrics for each day they were enrolled in the experiment. - -In WHN, only the Pulse Summary may be exported, as the other two types of data are only stored [in your warehouse](https://docs.statsig.com/statsig-warehouse-native/pipeline-overview/#artifacts-and-entity-relationships). The availability of these exports are subject to our retention policy. We hold exposures data for up-to 90 days after an experiment is concluded. We hold raw user-level metrics data for 90 days. - -### Pulse Summary File Description - For Feature Gates - -| Column Name | Description | -| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| name | Name of the Experiment or Feature Gate | -| rule | Name of the Feature Gate Rule. | -| metric_type | Category of the metric. Different metric_types are computed differently, including how they're computed in Pulse. | -| metric_name | The name of the metric. For event metrics, this is the name of the event. | -| metric_dimension | The subcategory of the metric. For example, if you log value in LogEvent, then value will show up as a subdimension. dimension = !statsig_topline indicates that this row reflects an aggregate across all dimensions. | -| start_date | The start date for this measurement | -| end_date | The end date for this measurement | -| test_units | The number of users in the test group | -| test_mean | The average value of this metric across test users (or participating units when applicable) | -| test_stderr | The standard error for the estimate of the mean for test users. This can be used to compute confidence intervals. | -| ctrl_units | The number of users in the control group | -| ctrl_mean | The average value of this metric across control users (or participating units when applicable) | -| ctrl_stderr | The standard error for the estimate of the mean for control users. This can be used to compute confidence intervals. | -| abs_delta | The absolute difference between the test and control mean (test_mean - ctrl_mean) | -| abs_stderr | The estimated standard error of abs_delta | -| rel_delta | The relative difference between test and control mean, sometimes referred to as lift (test_mean - ctrl_mean)/ctrl_mean | -| rel_stderr | The estimated standard error of rel_delta (abs_delta/ctrl_mean) | -| z_score | The calculated Z-score | - -### Pulse Summary File Description - For Experiments - -| Column Name | Description | -| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| name | Name of the Experiment or Feature Gate | -| rule | Name of the Feature Gate Rule. | -| experiment_group | The group of users for which this metric is computed for. For a feature gate, this is pass/fail. For an experiment, this is the variant name. | -| metric_type | Category of the metric. Different metric_types are computed differently, including how they're computed in Pulse. | -| metric_name | The name of the metric. For event metrics, this is the name of the event. | -| metric_dimension | The subcategory of the metric. For example, if you log value in LogEvent, then value will show up as a subdimension. dimension = !statsig_topline indicates that this row reflects an aggregate across all dimensions. | -| start_date | The start date for this measurement | -| end_date | The end date for this measurement | -| units | The number of users included in this metric estimate. | -| mean | The average value of this metric across units (or participating units when applicable) | -| stderr | The standard error for the estimate of the mean. This can be used to compute confidence intervals. | - -### First Exposures File Description - -| Column Name | Description | -| ----------------------- | --------------------------------------------------------------------------------------------- | -| unit_id | Refers to the unit identifier used in the experiment (eg. user_id, stable_id, org_id) | -| name | The name of the gate/experiment | -| rule | For gates, this refers to the rule name | -| experiment_group | The group the user was assigned to | -| first_exposure_utc | The UTC timestamp when the user was first assigned to the experiment | -| first_exposure_pst_date | The date in PST when the user was first assigned to the experiment | -| as_of_pst_date | The date this data was generated | -| user_dimensions | JSON-formatted key-value pairs describing the user's attributes at the time of first exposure | - -### Unit Metrics File Description - -| Column Name | Description | -| ---------------- | ------------------------------------------------------------------------------------------- | -| pst_ds | The 24hr window the the data refers to. All dates are anchored from 12:00a -> 11:59p PST. | -| unit_id | Refers to the unit identifier used in the experiment (eg. user_id, stable_id, org_id) | -| metric_type | The category of the metric | -| metric_name | The name of the metric | -| metric_dimension | The name of the metric dimension. '!statsig_topline' is the overall metric with no slicing. | -| metric_value | The numeric value of the metric | -| numerator | For some metrics, we track the numerator | -| denominator | For some metrics, we track the denominator | diff --git a/docs/pulse/faq-whn.md b/docs/pulse/faq-whn.md new file mode 100644 index 000000000..66e04deab --- /dev/null +++ b/docs/pulse/faq-whn.md @@ -0,0 +1,13 @@ +--- +title: Frequently Asked Questions on Using Pulse +sidebar_label: Pulse FAQs +slug: /pulse/best-faq-whn +keywords: + - owner:vm +last_update: + date: 2024-10-02 +--- + +import PulseFAQ from '@site/docs/pulse/faq.md'; + + \ No newline at end of file diff --git a/docs/pulse/faq.md b/docs/pulse/faq.md index c5d99f39c..3e7c27fd6 100644 --- a/docs/pulse/faq.md +++ b/docs/pulse/faq.md @@ -1,6 +1,6 @@ --- title: Frequently Asked Questions on Using Pulse -sidebar_label: FAQ +sidebar_label: Pulse FAQs slug: /pulse/best-faq keywords: - owner:vm diff --git a/docs/sdks/quickstart.mdx b/docs/sdks/quickstart.mdx new file mode 100644 index 000000000..21d8e461e --- /dev/null +++ b/docs/sdks/quickstart.mdx @@ -0,0 +1,176 @@ +--- +sidebar_label: Get Started +title: Get Started with the Statsig SDKs +keywords: + - owner:jinayoon +last_update: + date: 2025-04-07 +--- + +import GitHubEmbed from "@site/src/components/GitHubEmbed"; +import JSSnippets from "@site/src/components/JSSnippets"; +import { useState } from 'react'; +import CodeBlock from "@theme/CodeBlock"; + +import { + SDKDocsBuilder, + HOOK__SDKDocUpdate, +} from "../sdks/_SDKDocsBuilder.mdx"; + +import * as _ReactInstall from "../client/javascript-mono/react/_reactInstall.mdx"; +import * as _ReactSetup from "../client/javascript-mono/react/_reactSetup.mdx"; +export const ReactSetup = _ReactSetup; + +import * as _reactGatesAndConfigs from "../client/javascript-mono/react/_reactGatesAndConfigs.mdx"; +export const ReactGatesAndConfigs = _reactGatesAndConfigs; +export const ReactInstall = _ReactInstall; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; +import SDKAndFrameworks from '../../src/components/getting-started/SDKAndFrameworks'; +import Styles from '../../src/components/getting-started/Styles'; + + + +export const Builder = SDKDocsBuilder({ + sections: [ + ], +}); + +export const toc = Builder.toc + + +This quickstart will guide you through quickly installing the Statsig SDK in a client app. If you're looking for a more detailed guide, check out the [SDK Overview](/sdks/getting-started) or read about choosing between [client vs. server SDKs](/sdks/client-vs-server). +ReactReact, value: 'react'}, + {label: JavaScriptJS snippet, value: 'js'}, + {label: PythonPython, value: 'python'}, + {label: NodeNode, value: 'node'}, + {label: + iOS + Android + Flutter + Rust + Ruby + ... +24 more + , value: 'more'}, + ]}> + + + ### 1. Install Statsig packages + + ```bash + npm install @statsig/react-bindings + ``` + + ### 2. Import the StatsigProvider + In your App Router, import the StatsigProvider. + + ```tsx + import StatsigProvider from "@statsig/react-bindings"; + ``` + + ### 3. Wrap child components + Next, update your app's default function so that the StatsigProvider wraps around all child components. + + ```tsx + export default function RootLayout({ children }: { children: React.ReactNode }) { + return ( + + {children} + + ); + } + ``` + + ### 4. Add client key + Create a client API key in the [Statsig console Settings](https://console.statsig.com/api_keys). Copy and paste it to replace `` in the code snippet from the previous step. + + ### 5. Next steps + Congratulations! You've successfully set up the Statsig SDK in React. Continue on to the tutorials, or jump in to the full [Next.js](/client/javascript-sdk/next-js) or [React](/client/javascript-sdk/react) SDK libraries. + + + + + The easiest way to get up and running is by adding the Statsig JavaScript snippet to your website. + + ### 1. Paste the code snippet + In the `` section of your website, paste the following code snippet. + + ```html + + ``` + + ### 2. Add client key + Create a client API key in the [Statsig console Settings](https://console.statsig.com/api_keys). Copy and paste it to replace `` in the code snippet from the previous step. + + ### 3. Next steps + Congratulations! You've set up the Statsig JavaScript snippet. Once installed, you'll be able to: + - Start [recording events](/webanalytics/overview). + - Watch [session replays](/session-replay/overview). + - Run [experiments](/experiments-plus). + - Use [feature flags](/feature-flags/working-with). + + + ### 1. Install Statsig packages + ```shell +pip install statsig-python-core +``` + +### 2. Initialize the Statsig SDK + +```python +from statsig_python_core import Statsig, StatsigOptions + +options = StatsigOptions() +options.environment = "development" + +statsig = Statsig("", options) +statsig.initialize().wait() + +statsig.shutdown().wait() +``` + +### 3. Add server secret key +Create a server secret key in the [Statsig console Settings](https://console.statsig.com/api_keys). Copy and paste it to replace `` in the code snippet from the previous step. + +### 4. Next steps +Congratulations! You've successfully set up the Statsig SDK in Python. Continue on to the tutorials, or jump in to the full [Python](/server-core/python-core) SDK library. + + + + ### 1. Install Statsig packages + +```bash +npm i @statsig/statsig-node-core +``` + +### 2. Initialize the Statsig SDK +```jsx +// Basic initialization +const statsig = new Statsig(""); +await statsig.initialize(); + +// or with StatsigOptions +const options: StatsigOptions = { environment: "staging" }; + +const statsigWithOptions = new Statsig("secret-key", options); +await statsigWithOptions.initialize(); +``` + +### 3. Add server secret key +Create a server secret key in the [Statsig console Settings](https://console.statsig.com/api_keys). Copy and paste it to replace `` in the code snippet from the previous step. + +### 4. Next steps +Congratulations! You've successfully set up the Statsig SDK in Node.js. Continue on to the tutorials, or jump in to the full [Node.js](/server-core/node-core) SDK library. + + + + + + \ No newline at end of file diff --git a/docs/stats-engine/confidence-intervals-whn.mdx b/docs/stats-engine/confidence-intervals-whn.mdx new file mode 100644 index 000000000..f129e1917 --- /dev/null +++ b/docs/stats-engine/confidence-intervals-whn.mdx @@ -0,0 +1,13 @@ +--- +title: Confidence Intervals +sidebar_label: Confidence Intervals +slug: /stats-engine/confidence-intervals-whn +keywords: + - owner:vm +last_update: + date: 2025-03-06 +--- + +import ConfidenceIntervals from '@site/docs/stats-engine/confidence-intervals.mdx'; + + \ No newline at end of file diff --git "a/docs/stats-engine/methodologies/benjamini\342\200\223hochberg-procedure-whn.md" "b/docs/stats-engine/methodologies/benjamini\342\200\223hochberg-procedure-whn.md" new file mode 100644 index 000000000..d68944382 --- /dev/null +++ "b/docs/stats-engine/methodologies/benjamini\342\200\223hochberg-procedure-whn.md" @@ -0,0 +1,13 @@ +--- +title: Benjamini–Hochberg Procedure +sidebar_label: Benjamini–Hochberg +slug: /stats-engine/methodologies/benjamini–hochberg-procedure-whn +keywords: + - owner:vm +last_update: + date: 2024-10-14 +--- + +import Benjamini from '@site/docs/stats-engine/methodologies/benjamini–hochberg-procedure.md'; + + \ No newline at end of file diff --git a/docs/stats-engine/methodologies/bonferroni-correction-whn.md b/docs/stats-engine/methodologies/bonferroni-correction-whn.md new file mode 100644 index 000000000..47253c52c --- /dev/null +++ b/docs/stats-engine/methodologies/bonferroni-correction-whn.md @@ -0,0 +1,13 @@ +--- +title: Bonferroni Correction +sidebar_label: Bonferroni Correction +slug: /stats-engine/methodologies/bonferroni-correction-whn +keywords: + - owner:vm +last_update: + date: 2024-01-31 +--- + +import BonferroniCorrection from '@site/docs/stats-engine/methodologies/bonferroni-correction.md'; + + \ No newline at end of file diff --git a/docs/stats-engine/methodologies/cuped-whn.md b/docs/stats-engine/methodologies/cuped-whn.md new file mode 100644 index 000000000..cd0aeebde --- /dev/null +++ b/docs/stats-engine/methodologies/cuped-whn.md @@ -0,0 +1,13 @@ +--- +title: CUPED +sidebar_label: CUPED +slug: /stats-engine/methodologies/cuped-whn +keywords: + - owner:vm +last_update: + date: 2025-03-07 +--- + +import CUPED from '@site/docs/stats-engine/methodologies/cuped.md'; + + \ No newline at end of file diff --git a/docs/stats-engine/methodologies/delta-method-whn.md b/docs/stats-engine/methodologies/delta-method-whn.md new file mode 100644 index 000000000..f27b8cd62 --- /dev/null +++ b/docs/stats-engine/methodologies/delta-method-whn.md @@ -0,0 +1,13 @@ +--- +title: Delta Method +sidebar_label: Delta Method +slug: /stats-engine/methodologies/delta-method-whn +keywords: + - owner:vm +last_update: + date: 2022-10-27 +--- + +import DeltaMethod from '@site/docs/stats-engine/methodologies/delta-method.md'; + + \ No newline at end of file diff --git a/docs/stats-engine/methodologies/one-sided-test-whn.md b/docs/stats-engine/methodologies/one-sided-test-whn.md new file mode 100644 index 000000000..048b98053 --- /dev/null +++ b/docs/stats-engine/methodologies/one-sided-test-whn.md @@ -0,0 +1,14 @@ +--- +title: One-Sided Test +sidebar_label: One-Sided Tests +slug: /stats-engine/methodologies/one-sided-test-whn +keywords: + - owner:vm +last_update: + date: 2024-12-17 +--- + + +import OneSidedTest from '@site/docs/stats-engine/methodologies/one-sided-test.md'; + + diff --git a/docs/stats-engine/methodologies/srm-checks-whn.md b/docs/stats-engine/methodologies/srm-checks-whn.md new file mode 100644 index 000000000..55bcdc4e3 --- /dev/null +++ b/docs/stats-engine/methodologies/srm-checks-whn.md @@ -0,0 +1,13 @@ +--- +title: SRM Checks +sidebar_label: SRM Checks +slug: /stats-engine/methodologies/srm-checks-whn +keywords: + - owner:vm +last_update: + date: 2024-04-17 +--- + +import SRMChecks from '@site/docs/stats-engine/methodologies/srm-checks.md'; + + \ No newline at end of file diff --git a/docs/stats-engine/methodologies/winsorization-whn.md b/docs/stats-engine/methodologies/winsorization-whn.md new file mode 100644 index 000000000..796b4ff6a --- /dev/null +++ b/docs/stats-engine/methodologies/winsorization-whn.md @@ -0,0 +1,12 @@ +--- +title: Winsorization +sidebar_label: Winsorization +slug: /stats-engine/methodologies/winsorization-whn +keywords: + - owner:vm +last_update: + date: 2025-01-15 +--- +import Winsorization from '@site/docs/stats-engine/methodologies/winsorization.mdx'; + + \ No newline at end of file diff --git a/docs/stats-engine/metric-deltas-whn.mdx b/docs/stats-engine/metric-deltas-whn.mdx new file mode 100644 index 000000000..9ef976b14 --- /dev/null +++ b/docs/stats-engine/metric-deltas-whn.mdx @@ -0,0 +1,13 @@ +--- +title: Metric Deltas +sidebar_label: Metric Deltas +slug: /stats-engine/metric-deltas-whn +keywords: + - owner:vm +last_update: + date: 2024-10-31 +--- + +import MetricDeltas from '@site/docs/stats-engine/metric-deltas.mdx'; + + \ No newline at end of file diff --git a/docs/stats-engine/p-value-whn.mdx b/docs/stats-engine/p-value-whn.mdx new file mode 100644 index 000000000..ecd005047 --- /dev/null +++ b/docs/stats-engine/p-value-whn.mdx @@ -0,0 +1,13 @@ +--- +title: p-Value Calculation +sidebar_label: p-Values +slug: /stats-engine/p-value-whn +keywords: + - owner:vm +last_update: + date: 2024-10-31 +--- + +import PValue from '@site/docs/stats-engine/p-value.mdx'; + + \ No newline at end of file diff --git a/docs/stats-engine/pre-experiment-bias-whn.md b/docs/stats-engine/pre-experiment-bias-whn.md new file mode 100644 index 000000000..74669fba1 --- /dev/null +++ b/docs/stats-engine/pre-experiment-bias-whn.md @@ -0,0 +1,13 @@ +--- +title: Pre-Experiment Bias +sidebar_label: Pre-Experiment Bias +slug: /stats-engine/pre-experiment-bias-whn +keywords: + - owner:vm +last_update: + date: 2025-01-27 +--- + +import PreExpBias from '@site/docs/stats-engine/pre-experiment-bias.mdx'; + + \ No newline at end of file diff --git a/docs/stats-engine/topline-impact-whn.mdx b/docs/stats-engine/topline-impact-whn.mdx new file mode 100644 index 000000000..6f48f252f --- /dev/null +++ b/docs/stats-engine/topline-impact-whn.mdx @@ -0,0 +1,13 @@ +--- +title: Topline and Projected Impact +sidebar_label: Topline Impact +slug: /stats-engine/topline-impact-whn +keywords: + - owner:vm +last_update: + date: 2024-10-03 +--- + +import ToplineImpact from '@site/docs/stats-engine/topline-impact.mdx'; + + \ No newline at end of file diff --git a/docs/stats-engine/variance-reduction-whn.md b/docs/stats-engine/variance-reduction-whn.md new file mode 100644 index 000000000..e20ca64a7 --- /dev/null +++ b/docs/stats-engine/variance-reduction-whn.md @@ -0,0 +1,13 @@ +--- +title: Variance Reduction +sidebar_label: Variance Reduction +slug: /stats-engine/variance_reduction-whn +keywords: + - owner:vm +last_update: + date: 2025-02-13 +--- + +import VarianceReduction from '@site/docs/stats-engine/variance-reduction.md'; + + \ No newline at end of file diff --git a/docs/stats-engine/variance-whn.mdx b/docs/stats-engine/variance-whn.mdx new file mode 100644 index 000000000..810847923 --- /dev/null +++ b/docs/stats-engine/variance-whn.mdx @@ -0,0 +1,12 @@ +--- +title: Standard Error & Mean Variance +sidebar_label: Standard Error & Mean Variance +slug: /stats-engine/variance-whn +keywords: + - owner:vm +last_update: + date: 2025-01-24 +--- +import Variance from '@site/docs/stats-engine/variance.mdx'; + + \ No newline at end of file diff --git a/docs/statsig-warehouse-native/features/freshness.md b/docs/statsig-warehouse-native/features/freshness.md index da71111c2..7db2067e2 100644 --- a/docs/statsig-warehouse-native/features/freshness.md +++ b/docs/statsig-warehouse-native/features/freshness.md @@ -3,7 +3,6 @@ title: Early Diagnostics slug: /statsig-warehouse-native/features/early-diagnostics sidebar_label: Early Diagnostics description: Data Freshness -displayed_sidebar: cloud keywords: - owner:vm last_update: diff --git a/docs/statsig-warehouse-native/features/mex-on-warehouse-native.md b/docs/statsig-warehouse-native/features/mex-on-warehouse-native.md index ee96f4976..674e83636 100644 --- a/docs/statsig-warehouse-native/features/mex-on-warehouse-native.md +++ b/docs/statsig-warehouse-native/features/mex-on-warehouse-native.md @@ -1,7 +1,7 @@ --- title: MEX on Warehouse Native [Beta] slug: /statsig-warehouse-native/features/mex-on-warehouse-native -sidebar_label: MEX on Warehouse Native +sidebar_label: Metrics Explorer on WHN keywords: - owner:vm last_update: diff --git a/docs/statsig-warehouse-native/features/monitor-an-experiment.md b/docs/statsig-warehouse-native/features/monitor-an-experiment.md index d8cbafb68..8773a8237 100644 --- a/docs/statsig-warehouse-native/features/monitor-an-experiment.md +++ b/docs/statsig-warehouse-native/features/monitor-an-experiment.md @@ -3,7 +3,6 @@ title: Experiment Diagnostics slug: /statsig-warehouse-native/features/monitor-an-experiment sidebar_label: Diagnostics description: Monitor the health of experiments -displayed_sidebar: cloud keywords: - owner:vm last_update: diff --git a/docs/statsig-warehouse-native/guides/quick-start.md b/docs/statsig-warehouse-native/guides/quick-start.md index e2526f8ae..65c93c85b 100644 --- a/docs/statsig-warehouse-native/guides/quick-start.md +++ b/docs/statsig-warehouse-native/guides/quick-start.md @@ -1,6 +1,6 @@ --- -title: Quick Start -sidebar_label: Quick Start +title: Warehouse Native Quickstart +sidebar_label: WHN Quickstart slug: /statsig-warehouse-native/guides/quick-start keywords: - owner:vm @@ -8,21 +8,21 @@ last_update: date: 2024-07-11 --- -You can get experiment results in record time with Statsig Warehouse native. This page walks you through connecting your data, configuring a metric, and getting experiment results. +You can get experiment results in record time with Statsig Warehouse Native. This page walks you through connecting your data, configuring a metric, and getting experiment results. All you'll need is a table in your warehouse that has metric or event logging data. -# Step 1.) Connecting Your Warehouse +## Step 1: Connect Your Warehouse -Statsig will use your warehouse to store and analyze your experiment data - you have total control and visibility. To connect your warehouse, visit your warehouse's setup page. +Statsig will use your warehouse to store and analyze your experiment data; you have total control and visibility over the data itself. To connect your warehouse, visit your warehouse's setup page. -- [Bigquery](../connecting-your-warehouse/bigquery.md) +- [BigQuery](../connecting-your-warehouse/bigquery.md) - [Databricks](../connecting-your-warehouse/databricks.md) - [Redshift](../connecting-your-warehouse/redshift.md) - [Snowflake](../connecting-your-warehouse/snowflake.md) - [Athena](../connecting-your-warehouse/athena.md) -# Step 2.) Connect to Data +## Step 2: Connect to Data To connect your event or metric, data, you'll create a [Metric Source](/statsig-warehouse-native/configuration/metric-sources.md). Navigate to the Metric Sources page and click Create to make a new Metric Source. @@ -36,7 +36,7 @@ Press analyze to generate samples from your table, and then map required columns Save your changes, and you've connected to your data! -# Step 3.) Make a Metric +## Step 3: Make a Metric Now that you've connected to data, you can build metrics on top of this. Later, this can be configured programmatically, but for now navigate to your Metrics Catalog and click Create to make a new Metric. @@ -48,7 +48,7 @@ To get started, we recommend just making a [count metric](/statsig-warehouse-nat Select "Count" and save - or, feel free to pause here and explore the options here. -# Step 4.) Connect an Experiment +## Step 4: Connect an Experiment Next, you'll connect to experiment data. If you have a table with exposures you've already logged, feel free to use that. You'll just need to make sure that you've logged the same identifier there as you used in your metric source. @@ -66,7 +66,7 @@ Pressing save and scan will save your new source and detect experiments that exi ![Screenshot 2024-06-11 at 1 36 18 PM](https://github.com/statsig-io/docs/assets/102695539/8be2f079-4440-4742-9727-08e25b65c84b) -# Step 5.) Analyze Your Experiment +## Step 5: Analyze Your Experiment Press Create on your experiment of interest to start creating your experiment. @@ -80,7 +80,7 @@ Statsig will automatically detect the group split, but if the detected split is Press Save and Analyze, and Statsig will start calculating Pulse Results. You can track the progress in the loading bar at the bottom of the experiment's results page. -# Step 6.) Reading Results +## Step 6: Read Results If everything worked, you should see: diff --git a/docs/statsig-warehouse-native/guides/running_a_poc.mdx b/docs/statsig-warehouse-native/guides/running_a_poc.mdx index 5f6eefea9..2bec3eef4 100644 --- a/docs/statsig-warehouse-native/guides/running_a_poc.mdx +++ b/docs/statsig-warehouse-native/guides/running_a_poc.mdx @@ -1,4 +1,13 @@ -# Running a Warehouse Native (WHN) Proof Of Concept +--- +title: Running a Warehouse Native POC +slug: /statsig-warehouse-native/guides/running_a_poc +keywords: + - owner:vm +last_update: + date: 2025-01-15 +--- + +# Running a Warehouse Native Proof Of Concept The purpose of this guide is to give a general overview of how to plan a proof of concept with Statsig Warehouse Native (WHN). This guide articulates the high level components of our solution, the steps required for a customer to successfully lead a proof of concept and validation/next steps to move forward with a productionization. diff --git a/docs/statsig-warehouse-native/introduction.mdx b/docs/statsig-warehouse-native/introduction.mdx index 09735c231..a45e14eea 100644 --- a/docs/statsig-warehouse-native/introduction.mdx +++ b/docs/statsig-warehouse-native/introduction.mdx @@ -1,8 +1,6 @@ --- -title: Warehouse Native - Getting Started +title: About Warehouse Native slug: /statsig-warehouse-native/introduction -sidebar_label: Getting Started -description: Set up your first Statsig Warehouse Native project keywords: - owner:vm last_update: diff --git a/docs/statsig-warehouse-native/native-vs-cloud.md b/docs/statsig-warehouse-native/native-vs-cloud.md index f3fb329b3..8a17104b9 100644 --- a/docs/statsig-warehouse-native/native-vs-cloud.md +++ b/docs/statsig-warehouse-native/native-vs-cloud.md @@ -1,7 +1,7 @@ --- title: Comparing Warehouse Native and Cloud slug: /statsig-warehouse-native/native-vs-cloud -sidebar_label: Native vs Cloud +sidebar_label: WHN vs Cloud description: Understand the different Statsig products keywords: - owner:vm diff --git a/docs/statsig-warehouse-native/read-pulse-whn.mdx b/docs/statsig-warehouse-native/read-pulse-whn.mdx new file mode 100644 index 000000000..e7701ad85 --- /dev/null +++ b/docs/statsig-warehouse-native/read-pulse-whn.mdx @@ -0,0 +1,13 @@ +--- +title: Reading Pulse in WHN +sidebar_label: Read Results +slug: /pulse/read-pulse-whn +keywords: + - owner:vm +last_update: + date: 2024-11-01 +--- + +import ReadPulse from '@site/docs/pulse/read-pulse.md'; + + diff --git a/docs/understanding-platform.mdx b/docs/understanding-platform.mdx index a24a5819b..7ea9a7a28 100644 --- a/docs/understanding-platform.mdx +++ b/docs/understanding-platform.mdx @@ -7,8 +7,24 @@ last_update: date: 2024-12-26 --- +## What do I use Statsig for? -Statsig offers two flexible ways to leverage its core products based on your needs: Statsig Cloud (where we host your data) and Statsig Warehouse Native (where you host your data in your own warehouse). +Statsig's goal is to be the single platform to ship, measure, and learn from the products you build. The most popular features of Statsig are: + - [Feature Flags](/feature-flags/working-with/): Expose new features to select user groups, roll them out (and roll them back, when things go wrong), and measure the impact they have. + - [Experiments](/experiments-plus/): Run randomized, controlled experiments on different variations of your product, and measure the exact impact on your users. Customers use Statsig to run thousands of experiments each year, and iterate in the right direction. + - [Product Analytics](/product-analytics/overview/): Understand the trends of your core business metrics, user behavior, and more. +While these three are some of our most popular, Statsig offers other tools like [Session Replay](/session-replay/overview), [Web Analytics](/webanalytics/overview/) and all of these features together are greater than the sum of the parts. + +--- + +## How do I setup Statsig? + +While Statsig is flexible to many setups models, the most common setup approach is to integrate [Statsig's SDKs](sdks/quickstart/) which let you integrate flags/experiments, and track your core business metrics. While SDK installation is most common, you might want to bring existing data to Statsig. If so, you have a few options: + - **I'd like to bring existing data from my Data Warehouse:** You'll likely want to use [Statsig Warehouse Native](/statsig-warehouse-native/introduction), a zero-ETL model for running experiments and product analytics on top of your existing data. Alternatively, you can import warehouse data into Statsig Cloud with our [warehouse ingestions](https://docs.statsig.com/data-warehouse-ingestion/introduction/). + - **I'd like to bring existing data from my Segment, Rudderstack, Amplitude, or another platform:** Consider one of Statsig's [integrations](/integrations/introduction), which can port your events straight into Statsig Cloud. + - **I'd like to import my existing experiment assignment data, and use Statsig for Analysis:** You'll need to use [Statsig Warehouse Native](/statsig-warehouse-native/introduction). + +Statsig has two models to leverage its core products based on your needs: Statsig Cloud (where we host your data) and Statsig Warehouse Native (where you host your data in your own warehouse) a little more on each of these: --- @@ -16,8 +32,8 @@ Statsig offers two flexible ways to leverage its core products based on your nee With Statsig Cloud, setting up is simple. Install the Statsig SDK and configure event logging—we handle everything else. -- You get feature flags and 1 million metered events for free. -- Enjoy powerful analytics tools such as the Dashboard, Metrics Explorer, and Insights. +- You get feature flags and 2 million metered events for free. +- Enjoy powerful analytics tools such as Dashboards, Metrics Explorer, and Insights. - For more details on the pricing, check [our pricing page](https://www.statsig.com/pricing). Statsig Cloud is a great choice for those who want to get started quickly without needing to manage infrastructure or data warehousing. @@ -35,8 +51,9 @@ If your events and metrics already reside in your own data warehouse and you hav The first method helps you scale analysis, while the second can 10x your experimentation velocity. -> Note: WHN is available only with Enterprise contracts. If you’re interested in this option, check [this link](/statsig-warehouse-native/introduction) or [schedule a demo](https://www.statsig.com/contact/demo) with our Sales team. -> +:::note +WHN is available only with Enterprise contracts. If you’re interested in this option, check [this link](/statsig-warehouse-native/introduction) or [schedule a demo](https://www.statsig.com/contact/demo) with our Sales team. +::: --- diff --git a/docusaurus.config.ts b/docusaurus.config.ts index c72810fa6..e7e5c9cb2 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -135,6 +135,12 @@ const config: Config = { src: "/js/koala.js", }, }, + { + tagName: "script", + attributes: { + src: "/js/custom-search.js", + }, + }, ], }; }, @@ -448,37 +454,22 @@ const config: Config = { image: "img/docs_meta_q3_2023.png", docs: { sidebar: { - autoCollapseCategories: true, + autoCollapseCategories: false, }, }, algolia: { - // The application ID provided by Algolia appId: "JOWHDNMZRN", - // Public API key: it is safe to commit it apiKey: "2a538120ca7db3411698786731f3c2f6", indexName: "statsig", - // Optional: see doc section below - // contextualSearch: true, - - // // Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them. - // externalUrlRegex: 'external\\.com|domain\\.com', - - // // Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs - // replaceSearchResultPathname: { - // from: '/docs/', // or as RegExp: /\/docs\// - // to: '/', - // }, - - // // Optional: Algolia search parameters - // searchParameters: {}, + contextualSearch: true, - // // Optional: path for search page that enabled by default (`false` to disable it) - // searchPagePath: 'search', + searchParameters: { + facetFilters: [] + }, - // // Optional: whether the insights feature is enabled or not on Docsearch (`false` by default) insights: true, }, navbar: { @@ -490,14 +481,31 @@ const config: Config = { href: "/", }, items: [ + { + type: 'doc', + position: 'left', + docId: 'getting-started', + sidebarId: 'product-docs', + label: 'Product Docs', + id: 'product-docs', //don't edit this without rerunning algolia scraper + }, + { + type: 'docSidebar', + position: 'left', + sidebarId: 'warehouse', + label: 'Warehouse Native', + id: 'warehouse', //don't edit this without rerunning algolia scraper + }, + { + type: 'docSidebar', + position: 'left', + sidebarId: 'api', + label: 'SDKs & APIs', + id: 'sdk-api', //don't edit this without rerunning algolia scraper + }, { type: "search", }, - // { - // type: "html", - // value: - // "", - // }, { type: "html", value: diff --git a/package-lock.json b/package-lock.json index 10bb816e4..4c0754d98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@mdx-js/react": "^3.0.0", "@mui/material": "^5.16.7", "@radix-ui/react-slot": "^1.1.0", + "@staticons/react": "^0.1.0", "class-variance-authority": "^0.7.0", "clsx": "^2.0.0", "prism-react-renderer": "^2.3.0", @@ -4287,6 +4288,12 @@ "micromark-util-symbol": "^1.0.1" } }, + "node_modules/@staticons/react": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@staticons/react/-/react-0.1.0.tgz", + "integrity": "sha512-7oAxHvZCS85lzs6nECRrKKQAbKo6BgXI2IOS88hYGPZlG0BYkzo40qLCValztD4xfTz+r/yrz1lIwHQYFj8pJA==", + "license": "ISC" + }, "node_modules/@svgr/babel-plugin-add-jsx-attribute": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz", diff --git a/package.json b/package.json index f0576e4d5..63b2c3cd1 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@mdx-js/react": "^3.0.0", "@mui/material": "^5.16.7", "@radix-ui/react-slot": "^1.1.0", + "@staticons/react": "^0.1.0", "class-variance-authority": "^0.7.0", "clsx": "^2.0.0", "prism-react-renderer": "^2.3.0", diff --git a/sidebars.ts b/sidebars.ts index 5581d3e25..26d615874 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -17,322 +17,47 @@ const sidebars: SidebarsConfig = { label: "Overview", className: "doc-icon sidebar-icon", }, + { type: "category", - label: "Quickstart Guides", - collapsed: true, - className: "rocket-icon sidebar-icon", - items: [ - "guides/first-feature", - "guides/logging-events", - "guides/abn-tests", - ], - }, - { - type: "category", - label: "Core Concepts & Setup", + label: "Core Concepts", collapsed: true, className: "lightbulb-icon sidebar-icon", items: [ "understanding-platform", - "client/concepts/parameter-stores", - "guides/first-device-level-experiment", - "guides/experiment-on-custom-id-types", - "guides/using-environments", - "guides/testing", "guides/featureflags-or-experiments", + { - "Enterprise Concepts": [ + type: "category", + label: "Enterprise Topics", + collapsed: true, + items: [ "guides/experimentation-program", "guides/running-a-poc", "guides/production", - ], + ] }, ], }, + { type: "category", - label: "SDKs & APIs", - className: "doc-icon sidebar-icon", + label: "Tutorials", + collapsed: true, + className: "rocket-icon sidebar-icon", items: [ - "sdks/getting-started", - "sdks/client-vs-server", - "concepts/user", - "client/concepts/initialize", - "sdks/debugging", - { - className: "html-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/html-snippet", - }, - { - className: "js-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/javascript-sdk", - }, - { - className: "react-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/javascript-mono/ReactUsage", - }, - { - className: "next-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/javascript-mono/nextjs/NextJsUsage", - }, - { - className: "android-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/androidClientSDK", - }, - { - className: "ios-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/iosClientSDK", - }, - { - className: "node-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server-core/node-core", - }, - { - type: "category", - label: "More Client SDKs", - items: [ - { - className: "cpp-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/cpp-client-sdk", - }, - { - className: "flutter-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/dartSDK", - }, - { - className: "dotnet-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/dotnetSDK", - }, - { - className: "expo-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/javascript-mono/ExpoUsage", - }, - { - className: "react-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/javascript-mono/ReactNativeUsage", - }, - { - className: "angular-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/javascript-mono/AngularUsage", - }, - { - className: "roku-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/rokuSDK", - }, - { - className: "unity-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "client/unitySDK", - }, - { - type: "category", - label: "On Device Client SDKs", - items: [ - { - type: "category", - label: "JavaScript", - link: { - type: "doc", - id: "client/js-on-device-eval-client", - }, - items: [ - "client/js-device-eval-mono/MigrationFromOldSDK", - "client/js-device-eval-mono/UsingSpecsDataAdapter", - "client/js-device-eval-mono/ReactNativeUsage", - ], - }, - "client/swiftOnDeviceEvaluationSDK", - "client/androidOnDeviceEvaluationSDK", - ], - }, - { - type: "category", - label: "JavaScript - Maintainance Mode", - items: [ - "client/deprecated/jsClientSDK", - "client/deprecated/reactSDK", - "client/deprecated/reactNativeSDK", - "client/deprecated/reactNativeExpoSDK", - "client/jsLocalEvaluationSDK", - "client/javascript-mono/MigrationFromOldJsClient", - "client/javascript-mono/MigrationFromOldReact", - ], - }, - ], - }, - { - type: "category", - label: "More Server SDKs", - items: [ - { - className: "dotnet-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server/dotnetSDK", - }, - { - className: "cpp-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server/cppSDK", - }, - { - className: "golang-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server/golangSDK", - }, - { - className: "java-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server-core/java-core", - }, - { - className: "python-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server-core/python-core", - }, - { - className: "elixir-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server-core/elixir-core", - }, - { - className: "rust-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server-core/rust-core", - }, - { - className: "php-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server-core/php-core", - }, - { - className: "ruby-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server/rubySDK", - }, - { - type: "doc", - id: "server-core/index", - label: "Server Core Overview", - }, - - { - type: "category", - label: "Legacy Server SDKs", - link: { - type: "doc", - id: "server-core/legacy-sdks", - }, - items: [ - { - className: "node-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server/nodejsServerSDK", - }, - { - className: "python-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server/pythonSDK", - }, - { - className: "elixir-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server/erlangSDK", - }, - { - className: "java-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server/javaSdk", - }, - { - className: "rust-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server/rustSDK", - }, - { - className: "php-icon sidebar-icon sdk-sidebar-icon", - type: "doc", - id: "server/phpSDK", - }, - ], - }, - ], - }, - { - type: "category", - label: "Advanced SDK Methods", - items: [ - { - type: "category", - label: "Other Frameworks", - items: [ - "guides/node-express-feature-flags", - "guides/node-express-abtests", - "guides/python-flask-feature-flags", - "guides/python-flask-abtests", - ], - }, - "client/concepts/persistent_assignment", - "client/concepts/local-eval-adapter", - "server/concepts/persistent_assignment", - "server/concepts/data_store", - "sdk-keys/target-apps", - "server/deprecation-notices", - ], - }, - "http-api", - { - type: "category", - label: "Console API", - items: [ - "console-api/introduction", - "console-api/autogenerated", - "console-api/gates", - "console-api/segments", - "console-api/dynamic-configs", - "console-api/experiments", - "console-api/holdouts", - "console-api/layers", - "console-api/users", - "console-api/metrics", - "console-api/audit-logs", - "console-api/exposure-count", - "console-api/autotunes", - "console-api/target-apps", - "console-api/ingestions", - "console-api/tags", - "console-api/keys", - { - Reports: [ - "console-api/daily-reports", - "console-api/daily-reports-deprecated", - ], - }, - "console-api/usage-billing", - "console-api/rules", - ], - }, + "client/concepts/parameter-stores", + "guides/first-device-level-experiment", + "guides/experiment-on-custom-id-types", + "guides/using-environments", + "guides/testing", { type: "category", - label: "Statsig CLI", + label: "Migration Guides", + collapsed: true, items: [ - "siggy/introduction", - "siggy/commands", - "siggy/gate-management", + "guides/open-source-script", + "guides/ui-based-tool" ], }, ], @@ -671,218 +396,7 @@ const sidebars: SidebarsConfig = { "session-replay/configure", "session-replay/watch", ], - }, - { - type: "category", - label: "Warehouse Native", - className: "whn-icon sidebar-icon", - items: [ - "statsig-warehouse-native/introduction", - { - type: "category", - label: "Guides", - items: [ - "statsig-warehouse-native/guides/quick-start", - "statsig-warehouse-native/guides/running_a_poc", - "statsig-warehouse-native/guides/playground_eval", - "statsig-warehouse-native/guides/sdks", - "statsig-warehouse-native/guides/aatest", - "metrics/different-id", - { - type: "category", - label: "Debugging", - items: [ - "statsig-warehouse-native/guides/checklist", - "statsig-warehouse-native/guides/debugging", - "statsig-warehouse-native/guides/sql", - ], - }, - ], - }, - { - type: "category", - label: "Warehouse Integration", - items: [ - { - type: "category", - label: "Connect Your Warehouse", - items: [ - "statsig-warehouse-native/guides/connect", - "statsig-warehouse-native/connecting-your-warehouse/athena", - "statsig-warehouse-native/connecting-your-warehouse/bigquery", - "statsig-warehouse-native/connecting-your-warehouse/databricks", - "statsig-warehouse-native/connecting-your-warehouse/redshift", - "statsig-warehouse-native/connecting-your-warehouse/snowflake", - ], - }, - "statsig-warehouse-native/connecting-your-warehouse/forwarded-data", - "statsig-warehouse-native/analysis-tools/data-privacy", - "statsig-warehouse-native/guides/costs", - "statsig-warehouse-native/guides/best-practices", - ], - }, - { - type: "category", - label: "Data & Semantic Layer", - items: [ - "statsig-warehouse-native/configuration/data-and-semantic-layer", - "statsig-warehouse-native/configuration/metric-sources", - { - type: "category", - label: "Metrics", - link: { - type: "doc", - id: "statsig-warehouse-native/configuration/metrics", - }, - items: [ - "statsig-warehouse-native/metrics/sum", - "statsig-warehouse-native/metrics/count", - "statsig-warehouse-native/metrics/count-distinct", - "statsig-warehouse-native/metrics/unit-count-once", - "statsig-warehouse-native/metrics/unit-count-window", - "statsig-warehouse-native/metrics/unit-count-latest", - "statsig-warehouse-native/metrics/unit-count-rate", - "statsig-warehouse-native/metrics/mean", - "statsig-warehouse-native/metrics/ratio", - "statsig-warehouse-native/metrics/funnel", - "statsig-warehouse-native/metrics/percentile", - "statsig-warehouse-native/metrics/log", - "statsig-warehouse-native/metrics/latest-value", - "statsig-warehouse-native/metrics/retention", - "statsig-warehouse-native/metrics/max-min", - ], - }, - "statsig-warehouse-native/configuration/metric-examples", - "statsig-warehouse-native/configuration/dimensional-analysis", - "statsig-warehouse-native/configuration/assignment-sources", - "statsig-warehouse-native/configuration/entity-properties", - "statsig-warehouse-native/configuration/qualifying-events", - "statsig-warehouse-native/configuration/tags-and-teams", - "metrics/verified", - "statsig-warehouse-native/configuration/query-tools", - { - type: "category", - label: "Programmatic Management", - items: [ - "statsig-warehouse-native/configuration/console-api", - "statsig-warehouse-native/configuration/semantic-layer-sync", - ], - }, - "statsig-warehouse-native/features/roles-and-access", - ], - }, - { - type: "category", - label: "Experiment Analysis", - items: [ - "statsig-warehouse-native/features/experiment-options", - { - type: "category", - label: "Setup", - items: [ - "statsig-warehouse-native/features/understanding-experiments", - "statsig-warehouse-native/features/configure-an-experiment", - "statsig-warehouse-native/features/types-of-experiments", - "statsig-warehouse-native/features/power-analysis", - // "holdouts/introduction", - "experiments-plus/stratified-sampling", - "experiments-plus/differential-impact-detection", - "statsig-warehouse-native/features/targeting", - "statsig-warehouse-native/features/id-resolution", - "statsig-warehouse-native/features/filtering-exposures", - "statsig-warehouse-native/metrics/normalized-metrics", - ], - }, - { - type: "category", - label: "Loading Results", - link: { - type: "doc", - id: "statsig-warehouse-native/features/reloads", - }, - items: [ - "statsig-warehouse-native/features/turbo", - "statsig-warehouse-native/features/full-reloads", - "statsig-warehouse-native/features/incremental-reloads", - "statsig-warehouse-native/features/metric-reloads", - "statsig-warehouse-native/connecting-your-warehouse/scheduled-reloads", - "statsig-warehouse-native/analysis-tools/pipeline-overview", - "statsig-warehouse-native/features/freshness", - ], - }, - { - type: "category", - label: "Interpreting Results", - items: [ - "pulse/read-pulse", - "pulse/drill-down", - "pulse/custom-queries", - "pulse/export", - "pulse/best-practices", - "pulse/faq", - "statsig-warehouse-native/features/monitor-an-experiment", - ], - }, - { - type: "category", - label: "Statistics", - items: [ - "statsig-warehouse-native/features/statistics", - "stats-engine/metric-deltas", - "stats-engine/variance", - "stats-engine/confidence-intervals", - "stats-engine/p-value", - "stats-engine/topline-impact", - "stats-engine/variance-reduction", - // "stats-engine/offlineaa", - "stats-engine/pre-experiment-bias", - { - "Methodologies Used": [ - "stats-engine/methodologies/bonferroni-correction", - "stats-engine/methodologies/benjamini–hochberg-procedure", - "stats-engine/methodologies/cuped", - "stats-engine/methodologies/delta-method", - "stats-engine/methodologies/srm-checks", - "stats-engine/methodologies/winsorization", - "stats-engine/methodologies/one-sided-test", - ], - }, - ], - }, - "experiments/meta-analysis", - "insights/aggregated-impact", - "experiments/quality-score", - "statsig-warehouse-native/features/reports", - "statsig-warehouse-native/features/autotune", - "statsig-warehouse-native/features/use-case", - ], - }, - "statsig-warehouse-native/features/mex-on-warehouse-native", - "statsig-warehouse-native/features/other-useful-features", - "statsig-warehouse-native/native-vs-cloud", - { - type: "category", - label: "CURE", - link: { - type: "doc", - id: "statsig-warehouse-native/cure/introduction", - }, - items: ["statsig-warehouse-native/cure/cure-setup"], - }, - { - type: "category", - label: "Geotests", - link: { - type: "doc", - id: "statsig-warehouse-native/geotests/introduction", - }, - items: [ - "statsig-warehouse-native/geotests/geotests-setup", - "statsig-warehouse-native/geotests/methodology", - ], - }, - ], - }, + } ], }, { @@ -996,16 +510,6 @@ const sidebars: SidebarsConfig = { "integrations/openai", "experiments/statsiglite", "guides/statsig-id-resolver", - { - type: "category", - label: "Migrate from LaunchDarkly", - link: { - type: "doc", - id: "guides/migrate-from-launchdarkly", - }, - items: ["guides/open-source-script", "guides/ui-based-tool"], - }, - { "Data Imports (Deprecated)": [ "integrations/data-imports/overview-deprecated", @@ -1191,6 +695,571 @@ const sidebars: SidebarsConfig = { ], }, ], + api: [ + { + type: "category", + label: "SDK Quickstarts", + collapsed: false, + collapsible: false, + items: [ + "sdks/quickstart", + "guides/feature-gates-walkthrough", + "guides/logging-events", + "guides/abn-tests", + ], + }, + { + type: "category", + label: "Dev Concepts", + collapsed: false, + collapsible: false, + items: [ + "sdks/getting-started", + "sdks/client-vs-server", + "concepts/user", + "client/concepts/initialize", + "sdks/debugging", + ] + }, + { + type: "category", + label: "Client SDKs", + collapsed: false, + collapsible: false, + items: [ + { + className: "html-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/html-snippet", + }, + { + className: "js-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/javascript-sdk", + }, + { + className: "react-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/javascript-mono/ReactUsage", + }, + { + className: "next-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/javascript-mono/nextjs/NextJsUsage", + }, + { + className: "android-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/androidClientSDK", + }, + { + className: "ios-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/iosClientSDK", + }, + { + type: "category", + label: "More Client SDKs", + collapsed: true, + items: [ + { + className: "cpp-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/cpp-client-sdk", + }, + { + className: "flutter-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/dartSDK", + }, + { + className: "dotnet-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/dotnetSDK", + }, + { + className: "expo-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/javascript-mono/ExpoUsage", + }, + { + className: "react-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/javascript-mono/ReactNativeUsage", + }, + { + className: "angular-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/javascript-mono/AngularUsage", + }, + { + className: "roku-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/rokuSDK", + }, + { + className: "unity-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "client/unitySDK", + }, + { + type: "category", + label: "On Device Client SDKs", + items: [ + { + type: "category", + label: "JavaScript", + link: { + type: "doc", + id: "client/js-on-device-eval-client", + }, + items: [ + "client/js-device-eval-mono/MigrationFromOldSDK", + "client/js-device-eval-mono/UsingSpecsDataAdapter", + "client/js-device-eval-mono/ReactNativeUsage", + ], + }, + "client/swiftOnDeviceEvaluationSDK", + "client/androidOnDeviceEvaluationSDK", + ], + }, + { + type: "category", + label: "JavaScript - Maintainance Mode", + items: [ + "client/deprecated/jsClientSDK", + "client/deprecated/reactSDK", + "client/deprecated/reactNativeSDK", + "client/deprecated/reactNativeExpoSDK", + "client/jsLocalEvaluationSDK", + "client/javascript-mono/MigrationFromOldJsClient", + "client/javascript-mono/MigrationFromOldReact", + ], + }, + ], + }, + ], + }, + + { + type: "category", + label: "Server SDKs", + collapsed: false, + collapsible: false, + items: [ + + { + className: "node-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server-core/node-core", + }, + { + className: "python-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server-core/python-core", + }, + { + className: "golang-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server/golangSDK", + }, + { + className: "java-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server-core/java-core", + }, + { + className: "ruby-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server/rubySDK", + }, + { + type: "doc", + id: "server-core/index", + label: "Server Core Overview", + }, + { + type: "category", + label: "More Server SDKs", + items: [ + { + className: "dotnet-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server/dotnetSDK", + }, + { + className: "cpp-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server/cppSDK", + }, + { + className: "elixir-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server-core/elixir-core", + }, + { + className: "rust-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server-core/rust-core", + }, + { + className: "php-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server-core/php-core", + }, + ] + }, + + { + type: "category", + label: "Legacy Server SDKs", + link: { + type: "doc", + id: "server-core/legacy-sdks", + }, + items: [ + { + className: "node-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server/nodejsServerSDK", + }, + { + className: "python-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server/pythonSDK", + }, + { + className: "elixir-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server/erlangSDK", + }, + { + className: "java-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server/javaSdk", + }, + { + className: "rust-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server/rustSDK", + }, + { + className: "php-icon sidebar-icon sdk-sidebar-icon", + type: "doc", + id: "server/phpSDK", + }, + ], + }, + ], + }, + { + type: "category", + label: "More SDK Methods", + collapsed: true, + items: [ + "client/concepts/persistent_assignment", + "server/concepts/persistent_assignment", + "client/concepts/local-eval-adapter", + "server/concepts/data_store", + "sdk-keys/target-apps", + { + type: "category", + label: "Other Framework Guides", + items: [ + "guides/node-express-feature-flags", + "guides/node-express-abtests", + "guides/python-flask-feature-flags", + "guides/python-flask-abtests", + ], + }, + "server/deprecation-notices", + "http-api", + ], + }, + { + type: "category", + label: "Console API", + collapsed: true, + items: [ + "console-api/introduction", + "console-api/autogenerated", + "console-api/gates", + "console-api/segments", + "console-api/dynamic-configs", + "console-api/experiments", + "console-api/holdouts", + "console-api/layers", + "console-api/users", + "console-api/metrics", + "console-api/audit-logs", + "console-api/exposure-count", + "console-api/autotunes", + "console-api/target-apps", + "console-api/ingestions", + "console-api/tags", + "console-api/keys", + { + Reports: [ + "console-api/daily-reports", + "console-api/daily-reports-deprecated", + ], + }, + "console-api/usage-billing", + "console-api/rules", + ], + }, + { + type: "category", + label: "Statsig CLI", + collapsed: true, + items: [ + "siggy/introduction", + "siggy/commands", + "siggy/gate-management", + ], + }, + ], + warehouse: [ + { + type: "category", + label: "Introduction", + collapsed: false, + collapsible: false, + items: [ + { + type: "doc", + id: "statsig-warehouse-native/introduction", + label: "About Warehouse Native", + }, + "statsig-warehouse-native/guides/quick-start", + "statsig-warehouse-native/native-vs-cloud", + ] + }, + { + type: "category", + label: "Guides", + collapsed: false, + collapsible: false, + items: [ + { + type: "category", + label: "POCs & Evaluations", + collapsed: true, + items: [ + "statsig-warehouse-native/guides/running_a_poc", + "statsig-warehouse-native/guides/playground_eval", + "statsig-warehouse-native/guides/sdks", + "statsig-warehouse-native/guides/aatest", + "metrics/different-id", + ], + }, + { + type: "category", + label: "Debugging", + items: [ + "statsig-warehouse-native/guides/checklist", + "statsig-warehouse-native/guides/debugging", + "statsig-warehouse-native/guides/sql", + ], + }, + + "statsig-warehouse-native/connecting-your-warehouse/forwarded-data", + ], + }, + { + type: "category", + label: "Warehouse Integrations", + collapsed: false, + collapsible: false, + items: [ + "statsig-warehouse-native/guides/connect", + "statsig-warehouse-native/connecting-your-warehouse/snowflake", + "statsig-warehouse-native/connecting-your-warehouse/athena", + "statsig-warehouse-native/connecting-your-warehouse/bigquery", + "statsig-warehouse-native/connecting-your-warehouse/databricks", + "statsig-warehouse-native/connecting-your-warehouse/redshift", + ], + }, + { + type: "category", + label: "Data & Semantic Layer", + collapsed: true, + collapsible: false, + items: [ + "statsig-warehouse-native/configuration/data-and-semantic-layer", + "statsig-warehouse-native/configuration/metric-sources", + { + type: "category", + label: "Metrics", + link: { + type: "doc", + id: "statsig-warehouse-native/configuration/metrics", + }, + items: [ + "statsig-warehouse-native/metrics/sum", + "statsig-warehouse-native/metrics/count", + "statsig-warehouse-native/metrics/count-distinct", + "statsig-warehouse-native/metrics/unit-count-once", + "statsig-warehouse-native/metrics/unit-count-window", + "statsig-warehouse-native/metrics/unit-count-latest", + "statsig-warehouse-native/metrics/unit-count-rate", + "statsig-warehouse-native/metrics/mean", + "statsig-warehouse-native/metrics/ratio", + "statsig-warehouse-native/metrics/funnel", + "statsig-warehouse-native/metrics/percentile", + "statsig-warehouse-native/metrics/log", + "statsig-warehouse-native/metrics/latest-value", + "statsig-warehouse-native/metrics/retention", + "statsig-warehouse-native/metrics/max-min", + ], + }, + "statsig-warehouse-native/configuration/metric-examples", + "statsig-warehouse-native/configuration/dimensional-analysis", + "statsig-warehouse-native/configuration/assignment-sources", + "statsig-warehouse-native/configuration/entity-properties", + "statsig-warehouse-native/configuration/qualifying-events", + { + type: "category", + label: "Metric Management", + items: [ + "statsig-warehouse-native/configuration/tags-and-teams", + "statsig-warehouse-native/features/roles-and-access", + "metrics/verified", + "statsig-warehouse-native/configuration/query-tools", + ] + }, + { + type: "category", + label: "Programmatic Management", + items: [ + "statsig-warehouse-native/configuration/console-api", + "statsig-warehouse-native/configuration/semantic-layer-sync", + ], + }, + ], + }, + { + type: "category", + label: "Experiment Analysis", + collapsed: false, + collapsible: false, + items: [ + "statsig-warehouse-native/features/experiment-options", + { + type: "category", + label: "Setup", + items: [ + "statsig-warehouse-native/features/configure-an-experiment", + "statsig-warehouse-native/features/types-of-experiments", + "statsig-warehouse-native/features/power-analysis", + "experiments-plus/stratified-sampling-whn", + "experiments-plus/differential-impact-detection-whn", + "statsig-warehouse-native/features/targeting", + "statsig-warehouse-native/features/id-resolution", + "statsig-warehouse-native/features/filtering-exposures", + "statsig-warehouse-native/metrics/normalized-metrics", + "experiments/quality-score-whn", + ], + }, + { + type: "category", + label: "Loading Results", + link: { + type: "doc", + id: "statsig-warehouse-native/features/reloads", + }, + items: [ + "statsig-warehouse-native/features/turbo", + "statsig-warehouse-native/features/full-reloads", + "statsig-warehouse-native/features/incremental-reloads", + "statsig-warehouse-native/features/metric-reloads", + "statsig-warehouse-native/connecting-your-warehouse/scheduled-reloads", + "statsig-warehouse-native/analysis-tools/pipeline-overview", + "statsig-warehouse-native/features/freshness", + ], + }, + { + type: "category", + label: "Interpreting Results", + items: [ + "statsig-warehouse-native/read-pulse-whn", + "pulse/drill-down-whn", + "pulse/custom-queries-whn", + "pulse/access-whn", + "pulse/best-practices-whn", + "pulse/faq-whn", + "statsig-warehouse-native/features/monitor-an-experiment", + "statsig-warehouse-native/features/reports", + "insights/aggregated-impact-whn", + ], + }, + { + type: "category", + label: "Statistics", + items: [ + "statsig-warehouse-native/features/statistics", + "stats-engine/metric-deltas-whn", + "stats-engine/variance-whn", + "stats-engine/confidence-intervals-whn", + "stats-engine/p-value-whn", + "stats-engine/topline-impact-whn", + "stats-engine/variance-reduction-whn", + "stats-engine/pre-experiment-bias-whn", + { + "Methodologies Used": [ + "stats-engine/methodologies/bonferroni-correction-whn", + "stats-engine/methodologies/benjamini–hochberg-procedure-whn", + "stats-engine/methodologies/cuped-whn", + "stats-engine/methodologies/delta-method-whn", + "stats-engine/methodologies/srm-checks-whn", + "stats-engine/methodologies/winsorization-whn", + "stats-engine/methodologies/one-sided-test-whn", + ], + }, + ], + }, + { + type: "category", + label: "CURE", + items: [ + "statsig-warehouse-native/cure/introduction", + "statsig-warehouse-native/cure/cure-setup"], + }, + "experiments/meta-analysis-whn", + "statsig-warehouse-native/features/autotune", + "statsig-warehouse-native/features/use-case", + ], + }, + { + type: "category", + label: "Warehouse Management", + collapsed: true, + collapsible: false, + items: [ + "statsig-warehouse-native/analysis-tools/data-privacy", + "statsig-warehouse-native/guides/costs", + "statsig-warehouse-native/guides/best-practices", + ] + }, + { + type: "category", + label: "Other Features", + collapsed: true, + items: [ + "statsig-warehouse-native/features/mex-on-warehouse-native", + { + type: "category", + label: "Geotests", + items: [ + "statsig-warehouse-native/geotests/introduction", + "statsig-warehouse-native/geotests/geotests-setup", + "statsig-warehouse-native/geotests/methodology", + ], + }, + "statsig-warehouse-native/features/other-useful-features", + ], + }, + ] }; export default sidebars; diff --git a/src/components/Card/CardBody/index.js b/src/components/Card/CardBody/index.js new file mode 100644 index 000000000..5fb71fec2 --- /dev/null +++ b/src/components/Card/CardBody/index.js @@ -0,0 +1,44 @@ +import React, { CSSProperties } from 'react'; +import clsx from 'clsx'; +const CardBody = ({ + className, // classNamees for the container card + style, // Custom styles for the container card + children, // Content to be included within the card + textAlign, + variant, + italic = false , + noDecoration = false, + transform, + breakWord = false, + truncate = false, + weight, +}) => { + const text = textAlign ? `text--${textAlign}` :''; + const textColor = variant ? `text--${variant}` : ''; + const textItalic = italic ? 'text--italic' : ''; + const textDecoration = noDecoration ? 'text-no-decoration' : ''; + const textType = transform ? `text--${transform}` : ''; + const textBreak = breakWord ? 'text--break' : ''; + const textTruncate = truncate ? 'text--truncate' : ''; + const textWeight = weight ? `text--${weight}` : ''; + return ( +
+ {children} +
+ ); +} +export default CardBody; \ No newline at end of file diff --git a/src/components/Card/CardFooter/index.js b/src/components/Card/CardFooter/index.js new file mode 100644 index 000000000..2828f6109 --- /dev/null +++ b/src/components/Card/CardFooter/index.js @@ -0,0 +1,44 @@ +import React, { CSSProperties } from 'react'; +import clsx from 'clsx'; +const CardFooter = ({ + className, + style, + children, + textAlign, + variant, + italic = false , + noDecoration = false, + transform, + breakWord = false, + truncate = false, + weight, +}) => { + const text = textAlign ? `text--${textAlign}` :''; + const textColor = variant ? `text--${variant}` : ''; + const textItalic = italic ? 'text--italic' : ''; + const textDecoration = noDecoration ? 'text-no-decoration' : ''; + const textType = transform ? `text--${transform}` : ''; + const textBreak = breakWord ? 'text--break' : ''; + const textTruncate = truncate ? 'text--truncate' : ''; + const textWeight = weight ? `text--${weight}` : ''; + return ( +
+ {children} +
+ ); +} +export default CardFooter; \ No newline at end of file diff --git a/src/components/Card/CardHeader/index.js b/src/components/Card/CardHeader/index.js new file mode 100644 index 000000000..e8a81543e --- /dev/null +++ b/src/components/Card/CardHeader/index.js @@ -0,0 +1,44 @@ +import React, { CSSProperties } from 'react'; // CSSProperties allows inline styling with better type checking. +import clsx from 'clsx'; // clsx helps manage conditional className names in a clean and concise manner. +const CardHeader = ({ + className, // classNamees for the container card + style, // Custom styles for the container card + children, // Content to be included within the card + textAlign, + variant, + italic = false , + noDecoration = false, + transform, + breakWord = false, + truncate = false, + weight, +}) => { + const text = textAlign ? `text--${textAlign}` :''; + const textColor = variant ? `text--${variant}` : ''; + const textItalic = italic ? 'text--italic' : ''; + const textDecoration = noDecoration ? 'text-no-decoration' : ''; + const textType = transform ? `text--${transform}` : ''; + const textBreak = breakWord ? 'text--break' : ''; + const textTruncate = truncate ? 'text--truncate' : ''; + const textWeight = weight ? `text--${weight}` : ''; + return ( +
+ {children} +
+ ); +} +export default CardHeader; \ No newline at end of file diff --git a/src/components/Card/CardImage/index.js b/src/components/Card/CardImage/index.js new file mode 100644 index 000000000..731fc074d --- /dev/null +++ b/src/components/Card/CardImage/index.js @@ -0,0 +1,20 @@ +import React, { CSSProperties } from 'react'; +import clsx from 'clsx'; +import useBaseUrl from '@docusaurus/useBaseUrl'; // Import the useBaseUrl function from Docusaurus +const CardImage = ({ + className, + style, + cardImageUrl, + alt, + title, +}) => { + const generatedCardImageUrl = useBaseUrl(cardImageUrl); + return ( + {alt} + ) +} +export default CardImage; \ No newline at end of file diff --git a/src/components/Card/index.js b/src/components/Card/index.js new file mode 100644 index 000000000..6155b421b --- /dev/null +++ b/src/components/Card/index.js @@ -0,0 +1,16 @@ +import React, { CSSProperties } from 'react'; // CSSProperties allows inline styling with better type checking. +import clsx from 'clsx'; // clsx helps manage conditional className names in a clean and concise manner. +const Card = ({ + className, // Custom classes for the container card + style, // Custom styles for the container card + children, // Content to be included within the card + shadow, // Used to add shadow under your card. Expected values are: low (lw), medium (md), tall (tl) +}) => { + const cardShadow = shadow ? `item shadow--${shadow}` : ''; + return ( +
+ {children} +
+ ); +}; +export default Card; \ No newline at end of file diff --git a/src/components/Columns/Column/index.js b/src/components/Columns/Column/index.js new file mode 100644 index 000000000..5213dd1e6 --- /dev/null +++ b/src/components/Columns/Column/index.js @@ -0,0 +1,17 @@ +import React from 'react'; +// Import clsx library for conditional classes. +import clsx from 'clsx'; + +// Define the Column component as a function +// with children, className, style as properties +// Look https://infima.dev/docs/ for learn more +// Style only affects the element inside the column, but we could have also made the same distinction as for the classes. +export default function Column({ children , className, style }) { + return ( + +
+ {children} +
+ + ); +} \ No newline at end of file diff --git a/src/components/Columns/index.js b/src/components/Columns/index.js new file mode 100644 index 000000000..dfe7a0b91 --- /dev/null +++ b/src/components/Columns/index.js @@ -0,0 +1,17 @@ +import React from 'react'; +// Import clsx library for conditional classes. +import clsx from 'clsx'; +// Define the Columns component as a function +// with children, className, and style as properties +// className will allow you to pass either your custom classes or the native infima classes https://infima.dev/docs/layout/grid. +// Style" will allow you to either pass your custom styles directly, which can be an alternative to the "styles.module.css" file in certain cases. +export default function Columns({ children , className , style }) { + return ( + // This section encompasses the columns that we will integrate with children from a dedicated component to allow the addition of columns as needed +
+
+ {children} +
+
+ ); +} \ No newline at end of file diff --git a/src/components/getting-started/ResourceCard.module.css b/src/components/getting-started/ResourceCard.module.css index 7f771beb0..5f2e0de7b 100644 --- a/src/components/getting-started/ResourceCard.module.css +++ b/src/components/getting-started/ResourceCard.module.css @@ -31,7 +31,8 @@ } .resourceCard:hover { - background-color: #f7fafc; /* Light grey color on hover */ + background-color: #f7fafc; + /* Light grey color on hover */ box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06); } diff --git a/src/components/getting-started/Resources.jsx b/src/components/getting-started/Resources.jsx index 1ca2e874c..9e6a6b9a3 100644 --- a/src/components/getting-started/Resources.jsx +++ b/src/components/getting-started/Resources.jsx @@ -60,4 +60,4 @@ function ResourceCard({ resourceText, icon, url }) { ); } -export default LandingResources; +export default LandingResources; \ No newline at end of file diff --git a/src/css/custom.css b/src/css/custom.css index 9f0606bec..881ee79d6 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -18,26 +18,33 @@ h4, h5 { font-weight: 700; } + article header h1 { font-size: 2rem !important; } + h1 { font-size: 1.7rem; } + h2 { font-size: 1.3rem; } + h3 { font-size: 1.1rem; margin-bottom: 0.5rem !important; } + h4 { font-size: 1rem; margin-bottom: 0.5rem !important; } + h5 { font-size: 1rem; } + a { font-weight: 500; } @@ -137,7 +144,8 @@ html[data-theme="dark"] { } .katex .base { - vertical-align: 0em; /* Adjust this value as needed */ + vertical-align: 0em; + /* Adjust this value as needed */ } .menu__link { @@ -231,14 +239,17 @@ span.math.math-inline { .col { padding: 0px 60px; } - .navbar__items > div:has(.DocSearch) { + + .navbar__items>div:has(.DocSearch) { margin-left: auto; margin-right: 40px; } + .navbar__logo { height: 25px; margin-left: 5px; } + .DocSearch-Button { min-width: 350px; } @@ -248,7 +259,7 @@ span.math.math-inline { margin-bottom: 16px; } -.theme-doc-sidebar-item-category-level-1 > .menu__list-item-collapsible { +.theme-doc-sidebar-item-category-level-1>.menu__list-item-collapsible { /* border-bottom: 1px solid #e0e0e0; */ border-top: 1px solid #e0e0e0; /* padding-bottom: 5px; */ @@ -256,23 +267,22 @@ span.math.math-inline { padding-top: 15px; } -.theme-doc-sidebar-item-category-level-1 - > .menu__list-item-collapsible - > .menu__link { +.theme-doc-sidebar-item-category-level-1>.menu__list-item-collapsible>.menu__link { color: gray; font-size: 12px; font-family: "Open Sans", sans-serif; margin-left: 8px; } -.theme-doc-sidebar-item-category-level-1 - > .menu__list-item-collapsible { +.theme-doc-sidebar-item-category-level-1>.menu__list-item-collapsible { background: none; } -.menu__list > .menu__list-item:first-child .menu__list-item-collapsible { - border-top: none; /* Remove border-top for the first element */ - padding-top: 0; /* Adjust padding if necessary */ +.menu__list>.menu__list-item:first-child .menu__list-item-collapsible { + border-top: none; + /* Remove border-top for the first element */ + padding-top: 0; + /* Adjust padding if necessary */ } .theme-doc-sidebar-item-category-level-2 .menu__list { @@ -283,11 +293,11 @@ span.math.math-inline { font-weight: 600; } -.sidebar-icon > .menu__link { +.sidebar-icon>.menu__link { padding-left: calc(25px + var(--ifm-menu-link-padding-horizontal)); } -.sidebar-icon > .menu__list-item-collapsible { +.sidebar-icon>.menu__list-item-collapsible { padding-left: 25px; } @@ -305,8 +315,7 @@ span.math.math-inline { margin-left: 8px; background-size: contain; background-repeat: no-repeat; - margin: var(--ifm-menu-link-padding-vertical) - var(--ifm-menu-link-padding-horizontal); + margin: var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal); } /* @@ -582,13 +591,11 @@ span.math.math-inline { } [data-theme="dark"] .sidebar-icon:not(.sdk-sidebar-icon)::before { - filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) - contrast(0%); + filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(0%); } [data-theme="dark"] .menu__link--sublist-caret::after { - filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) - contrast(0%); + filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(0%); } .no-background { @@ -597,3 +604,116 @@ span.math.math-inline { --ifm-tabs-color-active-border: var(--ifm-color-primary-light); --ifm-tabs-color-active: var(--ifm-color-primary-light); } + + +.welcome-card-container { + display: flex; + flex-wrap: wrap; + gap: 20px; + justify-content: flex-start; +} + +.welcome-card { + flex: 1 1 300px; + min-width: 0; + max-width: 100%; + display: flex; + flex-direction: column; + background: #fff; + border-radius: 8px; + padding: 20px; + box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); + transition: box-shadow 0.2s ease; +} + +.welcome-card>* { + flex-grow: 1; + min-width: 0; +} + +.welcome-card .icon { + filter: none; +} + +.welcome-card h3 { + color: #000; + margin-top: 12px; + margin-bottom: 8px; + word-wrap: break-word; +} + +.welcome-card p { + color: #333; + margin-bottom: 16px; + word-wrap: break-word; +} + +html[data-theme='dark'] .welcome-card { + box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3); +} + +/* Navbar responsive styles */ +.navbar__items { + gap: 1rem; +} + +.navbar__item { + white-space: nowrap; + /* font-size: 0.9rem; */ +} + +.navbar__link--active { + position: relative; + + &::after { + content: ''; + position: absolute; + bottom: 0; + left: var(--ifm-navbar-item-padding-horizontal); + right: var(--ifm-navbar-item-padding-horizontal); + height: 2px; + background-color: var(--ifm-color-primary); + } +} + +.navbar__logo { + height: 25px; + margin-right: 0.5rem; +} + +.DocSearch-Button { + min-width: 200px; + max-width: 100%; +} + +@media (max-width: 1200px) { + .navbar__items { + gap: 0.5rem; + } + + .navbar__item { + font-size: 0.85rem; + } + + .DocSearch-Button { + min-width: 180px; + } +} + +@media (max-width: 996px) { + .navbar__items { + gap: 0.25rem; + } + + .navbar__item { + font-size: 0.8rem; + } + + .DocSearch-Button { + min-width: 150px; + } + + .navbar__logo { + height: 22px; + } +} \ No newline at end of file diff --git a/src/theme/MDXComponents.js b/src/theme/MDXComponents.js new file mode 100644 index 000000000..c62231938 --- /dev/null +++ b/src/theme/MDXComponents.js @@ -0,0 +1,22 @@ +import React from 'react'; +// Importing the original mapper + our components according to the Docusaurus doc +import MDXComponents from '@theme-original/MDXComponents'; +import Card from '@site/src/components/Card'; +import CardBody from '@site/src/components/Card/CardBody'; +import CardFooter from '@site/src/components/Card/CardFooter'; +import CardHeader from '@site/src/components/Card/CardHeader'; +import CardImage from '@site/src/components/Card/CardImage'; +import Columns from '@site/src/components/Columns'; +import Column from '@site/src/components/Columns/Column'; +export default { + // Reusing the default mapping + ...MDXComponents, + Card, + CardHeader, + CardBody, + CardFooter, + CardImage, + Columns, + Column +}; + diff --git a/static/img/icons/chevron-right.svg b/static/img/icons/chevron-right.svg new file mode 100644 index 000000000..513c7c6c7 --- /dev/null +++ b/static/img/icons/chevron-right.svg @@ -0,0 +1,6 @@ + + + + diff --git a/static/img/icons/description.svg b/static/img/icons/description.svg new file mode 100644 index 000000000..49aa84ef7 --- /dev/null +++ b/static/img/icons/description.svg @@ -0,0 +1,6 @@ + + + + diff --git a/static/img/icons/flash.svg b/static/img/icons/flash.svg new file mode 100644 index 000000000..e58296692 --- /dev/null +++ b/static/img/icons/flash.svg @@ -0,0 +1,6 @@ + + + + diff --git a/static/img/icons/organization.svg b/static/img/icons/organization.svg new file mode 100644 index 000000000..11b254715 --- /dev/null +++ b/static/img/icons/organization.svg @@ -0,0 +1,6 @@ + + + + diff --git a/static/img/icons/reset.svg b/static/img/icons/reset.svg new file mode 100644 index 000000000..54fc43c3b --- /dev/null +++ b/static/img/icons/reset.svg @@ -0,0 +1,6 @@ + + + + diff --git a/static/js/custom-search.js b/static/js/custom-search.js new file mode 100644 index 000000000..0d9d70111 --- /dev/null +++ b/static/js/custom-search.js @@ -0,0 +1,160 @@ +/** + * Statsig Search Customization + * + * This script customizes the Algolia search functionality in the Statsig docs site + * to scope search results based on the current navigation section. + */ +(function() { + console.log('[Statsig Search] Script loaded'); + + const originalXHR = window.XMLHttpRequest; + const originalFetch = window.fetch; + + let isSearchRequest = false; + + function getCurrentSection() { + const currentPageLink = document.querySelector('nav a[aria-current="page"]').id || "docs"; + console.log('[Statsig Search] Current section:', currentPageLink); + return currentPageLink; + } + + function addSectionIndicator(section) { + console.log('[Statsig Search] Adding section indicator for', section); + + const checkForSearchModal = setInterval(() => { + const searchForm = document.querySelector('.DocSearch-Form'); + if (!searchForm) return; + + clearInterval(checkForSearchModal); + + let indicator = document.querySelector('#statsig-section-indicator'); + if (!indicator) { + indicator = document.createElement('div'); + indicator.id = 'statsig-section-indicator'; + indicator.style.position = 'absolute'; + indicator.style.right = '50px'; + indicator.style.top = '12px'; + indicator.style.fontSize = '12px'; + indicator.style.fontWeight = 'bold'; + indicator.style.zIndex = '100'; + indicator.style.padding = '2px 6px'; + indicator.style.borderRadius = '4px'; + searchForm.appendChild(indicator); + } + + if (section === 'api') { + indicator.textContent = 'Searching in: SDKs & APIs'; + indicator.style.backgroundColor = '#e6f7ff'; + indicator.style.color = '#0066cc'; + } else if (section === 'warehouse') { + indicator.textContent = 'Searching in: Warehouse Native'; + indicator.style.backgroundColor = '#e6ffe6'; + indicator.style.color = '#006600'; + } else { + indicator.textContent = 'Searching in: Product Docs'; + indicator.style.backgroundColor = '#f0f0f0'; + indicator.style.color = '#666666'; + } + + console.log('[Statsig Search] Section indicator added'); + }, 100); + } + + function applyFiltersToRequest(request, section) { + // Apply filter as a top-level property in the request object + // instead of encoding it in the params string + request.filters = `section:${section}`; + return request; + } + + window.XMLHttpRequest = function() { + const xhr = new originalXHR(); + const originalOpen = xhr.open; + const originalSend = xhr.send; + + xhr.open = function() { + const url = arguments[1]; + + if (url && typeof url === 'string' && url.includes('algolia.net')) { + isSearchRequest = true; + console.log('[Statsig Search] Detected Algolia XHR request'); + } + + return originalOpen.apply(this, arguments); + }; + + xhr.send = function(body) { + if (isSearchRequest && body) { + try { + const section = getCurrentSection(); + const data = JSON.parse(body); + + if (Array.isArray(data.requests)) { + data.requests = data.requests.map(request => applyFiltersToRequest(request, section)); + } + + body = JSON.stringify(data); + } catch (e) { + console.error('[Statsig Search] Error modifying Algolia XHR request:', e); + } + + isSearchRequest = false; + } + + return originalSend.call(this, body); + }; + + return xhr; + }; + + window.fetch = function(resource, init) { + const isAlgoliaRequest = + (typeof resource === 'string' && resource.includes('algolia.net')) || + (resource instanceof Request && resource.url.includes('algolia.net')); + + if (isAlgoliaRequest && init && init.body) { + try { + const section = getCurrentSection(); + const data = JSON.parse(init.body); + + if (Array.isArray(data.requests)) { + data.requests = data.requests.map(request => applyFiltersToRequest(request, section)); + } + + init.body = JSON.stringify(data); + } catch (e) { + console.error('[Statsig Search] Error intercepting Algolia fetch request:', e); + } + } + + return originalFetch.call(window, resource, init); + }; + + // Initialize the search customization + function initialize() { + console.log('[Statsig Search] Initializing search customization'); + + document.addEventListener('click', function(event) { + if (event.target.closest('.DocSearch-Button')) { + console.log('[Statsig Search] Search button clicked'); + addSectionIndicator(getCurrentSection()); + } + }, true); + + document.addEventListener('keydown', function(event) { + if ((event.ctrlKey || event.metaKey) && event.key === 'k') { + console.log('[Statsig Search] Keyboard shortcut detected'); + addSectionIndicator(getCurrentSection()); + } + }); + + console.log('[Statsig Search] Search customization initialized'); + } + + // Initialize when the DOM is ready + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', initialize); + } else { + initialize(); + } +})(); diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 000000000..3172d2627 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,28 @@ +const path = require('path'); + +module.exports = { + // Adjust the entry point as needed for your project + entry: './src/index.js', + module: { + rules: [ + { + test: /\.tsx?$/, + // Exclude all node_modules except @staticons/react so that its TS files are transpiled + exclude: /node_modules\/(?!@staticons\/react)/, + use: 'ts-loader', + }, + { + test: /\.jsx?$/, + exclude: /node_modules/, + use: 'babel-loader', + }, + ], + }, + resolve: { + extensions: ['.tsx', '.ts', '.js', '.jsx'], + }, + output: { + filename: 'bundle.js', + path: path.resolve(__dirname, 'dist'), + }, +}; \ No newline at end of file