-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-mfa-in-docs
- Loading branch information
Showing
33 changed files
with
268 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
sidebar_label: HTML Snippet | ||
title: HTML Snippet SDK | ||
--- | ||
|
||
import { | ||
SDKDocsBuilder, | ||
HOOK__SDKDocUpdate, | ||
} from "../sdks/_SDKDocsBuilder.mdx"; | ||
|
||
import { | ||
Repository, | ||
FAQ, | ||
StatsigUser, | ||
StatsigOptions, | ||
} from "./Templates/index.mdx"; | ||
|
||
import Install from "./html/_install.mdx"; | ||
import Initialize from "./html/_initialize.mdx"; | ||
import MoreFAQs from "./html/_faqs.mdx"; | ||
|
||
export const Builder = SDKDocsBuilder({ | ||
sections: [ | ||
[ | ||
Repository, | ||
{ | ||
repo: "https://github.com/statsig-io/js-client-monorepo", | ||
}, | ||
], | ||
] | ||
}) | ||
|
||
export const toc = Builder.toc | ||
|
||
<>{Builder.result}</> | ||
<Install /> | ||
<Initialize /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import GitHubEmbed from "@site/src/components/GitHubEmbed"; | ||
|
||
#### I want to customize the initialization logic, can I do that? | ||
|
||
Yes, you can remove the client API key from the url and see the [Javascript SDK Getting Started Guide](https://docs.statsig.com/client/javascript-sdk#getting-started) for more information. The HTML snippet is just our javascript SDK - providing an api key in the url will auto initialize an instance for you, but if you don't want that, you can use it just like the javascript SDK. | ||
|
||
You will need to create your own instance differently than if you were installing the sdk via npm: | ||
|
||
```js | ||
const client = new window.__STATSIG__.StatsigClient("client-test", { userID: "123"}, {}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import GitHubEmbed from "@site/src/components/GitHubEmbed"; | ||
|
||
### Initialize the SDK | ||
|
||
The HTML snippet we provide wraps an instance of the statsig javascript sdk. Simply providing your client API key in the url is enough to auto initialize the SDK, as the installation step recommends. | ||
|
||
However, you should likely move to a manual initialization if you need any of the following: | ||
|
||
- custom user properties | ||
- custom initialization options | ||
- check gates, configs, experiments, or log events | ||
|
||
To manually initialize an instance of the sdk, remove the key parameter from the script tag, and do the following: | ||
|
||
|
||
```js | ||
const client = new window.__STATSIG__.StatsigClient( | ||
"client-test", | ||
{ userID: "123"}, // StatsigUser | ||
{}, // StatsigOptions | ||
); | ||
|
||
await client.initializeAsync(); | ||
|
||
// check gates, configs, experiments, or log events | ||
``` | ||
|
||
The `StatsigClient` instance you create is also available via `window.Statsig`, so you can reference it globally. | ||
|
||
At this point, you have access to all of the methods available in the [Javascript SDK](/client/javascript-sdk) via your instance of the `StatsigClient`. Refer to that documentation for initialization details and core methods. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Tabs from "@theme/Tabs"; | ||
import TabItem from "@theme/TabItem"; | ||
|
||
## Install the SDK | ||
|
||
You can install the Statsig SDK by putting a script tag in the head of your HTML file: | ||
|
||
```js | ||
<script src="https://cdn.jsdelivr.net/npm/@statsig/js-client@3/build/statsig-js-client+session-replay+web-analytics.min.js?apikey=YOUR_CLIENT_API_KEY"> | ||
</script> | ||
``` | ||
|
||
Note that you need to replace `YOUR_CLIENT_API_KEY` with your actual client API key from the [Project Settings > API Keys](https://console.statsig.com/api_keys). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/stats-engine/methodologies/winsorization_variants/warehouse.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Statsig Warehouse Native lets you configure this per metric - and choose explicitly the upper and/or lower bounds to apply. | ||
![image](https://github.com/statsig-io/docs/assets/31516123/6d058842-27f7-4b6b-9bd8-245a5f894f90) | ||
|
||
Winsorization is applied to to sum and event count metrics. Winsorization will not be applied to Mean, Ratio, Funnel or Participation. | ||
Winsorization is applied to to sum, event count, mean and ratio metrics. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.