Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ai-evals/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ import WrapOpenAI from '/snippets/ai-sdks/node/wrapOpenAI.mdx'
import LogEvalResult from '/snippets/ai-sdks/node/logEvalResult.mdx'
import GetPrompt from '/snippets/ai-sdks/node/getPrompt.mdx'
import Otel from '/snippets/ai-sdks/node/otel.mdx'
import AiOptions from '/snippets/ai-sdks/node/aiOptions.mdx'
import ProgrammaticEval from '/snippets/ai-sdks/node/programmatic-eval.mdx'

import InitializationPreamble from '/snippets/ai-sdks/initialization.mdx'
import InitializationManagedPreamble from '/snippets/ai-sdks/initializationManaged.mdx'
import WrapOpenAIPreamble from '/snippets/ai-sdks/wrapOpenAI.mdx'
import LogEvalResultPreamble from '/snippets/ai-sdks/logEvalResult.mdx'
import GetPromptPreamble from '/snippets/ai-sdks/getPrompt.mdx'
import AiOptionsPreamble from '/snippets/ai-sdks/aiOptions.mdx'
import OtelPreamble from '/snippets/ai-sdks/otel.mdx'
import ProgrammaticEvalPreamble from '/snippets/ai-sdks/programmatic-eval.mdx'

Expand Down Expand Up @@ -80,9 +78,6 @@ If you already have a Statsig instance, you can pass it into the SDK. Otherwise,
<WrapOpenAIPreamble/>
<WrapOpenAI/>

<AiOptionsPreamble/>
<AiOptions/>

## Using other SDK methods
Whether you passed in a Statsig instance or not, you can access the Statsig instance from the statsigAI instance, and use its many methods:
```javascript
Expand Down
1 change: 0 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@
"metrics/pulse",
"metrics/local-metrics",
"metrics/console",
"metrics/health-checks",
{
"group": "Metrics 201 - Creating Metrics",
"pages": [
Expand Down
2 changes: 0 additions & 2 deletions docs/server-core/node/migration-guide/_api_changes.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

### Key Package and Class Changes

Expand Down
39 changes: 0 additions & 39 deletions docs/server-core/node/migration-guide/_user_creation.mdx

This file was deleted.

112 changes: 40 additions & 72 deletions docs/server-core/node/migration-guide/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,24 @@ title: Node Core SDK Migration Guide
displayed_sidebar: api
---

import CodeBlock from '@theme/CodeBlock';
import {
SDKDocsBuilder,
} from "../../../sdks/_SDKDocsBuilder.mdx";

import {
APIChanges,
GlobalChanges,
Installation,
MigrationHelp,
StatsigOptions,
UserCreation,
NeedHelp,
Troubleshooting,
Intro,
} from "../../MigrationGuideTemplates/index.mdx";
import NodeAPIChanges from "./_api_changes.mdx";
import NodeUserCreation from "./_user_creation.mdx";
import NodeStatsigOptions from "./_statsig_options.mdx";

export const Builder = SDKDocsBuilder({
sections: [
[
Intro,
{
sdkType: "Node JS",
},
],

[
Installation,
{
legacyInstall: <CodeBlock>npm install statsig-node</CodeBlock>,
install: <CodeBlock>npm install @statsig/statsig-node-core</CodeBlock>,
},
],
[
UserCreation,
{
newUserCreation: <CodeBlock language="nodejs">
This guide walks through migrating from the legacy `statsig-node` SDK to the
Node Core SDK (`@statsig/statsig-node-core`).

## Installation

**Node Core SDK**
<CodeBlock>npm install @statsig/statsig-node-core</CodeBlock>

**Legacy Node SDK**
<CodeBlock>npm install statsig-node</CodeBlock>

## User creation

**Node Core SDK**
<CodeBlock language="nodejs">
{`import {StatsigUser} from "@statsig/statsig-node-core"
const user = new StatsigUser({
userID: "user_123",
Expand All @@ -54,8 +32,10 @@ const user = new StatsigUser({
"subscription_level": "premium"
}
})
`}</CodeBlock>,
legacyUserCreation: <CodeBlock language="python">
`}</CodeBlock>

**Legacy Node SDK**
<CodeBlock language="python">
{`import type {StatsigUser} from "statsig-node"
user = {
userID: "user_123",
Expand All @@ -67,38 +47,26 @@ user = {
"subscription_level": "premium"
}
}
`}</CodeBlock>,
}
],
[
APIChanges,
{
apiChanges: <NodeAPIChanges />
}
],
[
GlobalChanges,
{
waitForUserAgentInit: "wait_for_user_agent_init",
waitForCountryLookupInit: "wait_for_country_lookup_init",
disableUserAgentParsing: "disable_user_agent_parsing",
disableCountryLookup: "disable_country_lookup",
enableIdLists: "enable_id_lists"
},
],
[
StatsigOptions,
{
optionsMapping: <NodeStatsigOptions />
}
],
[
NeedHelp,
{}
],
]
})
`}</CodeBlock>

## API changes

<NodeAPIChanges />

## Global option name changes

| Legacy option | Node Core option |
| --- | --- |
| `waitForUserAgentInit` | `wait_for_user_agent_init` |
| `waitForCountryLookupInit` | `wait_for_country_lookup_init` |
| `disableUserAgentParsing` | `disable_user_agent_parsing` |
| `disableCountryLookup` | `disable_country_lookup` |
| `enableIdLists` | `enable_id_lists` |

## Statsig options

<NodeStatsigOptions />

export const toc = Builder.toc;
## Need help?

<>{Builder.result}</>
If you run into issues while migrating, reach out to your Statsig contact.
25 changes: 11 additions & 14 deletions experiments/implementation/getting-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,14 @@ As you can see, using parameters directly when you are coding is much simpler an

The diagnostics stream is meant to be used for debugging your integration, and understanding which groups a user is being bucketed into. The following defines the different Rules you will see, and what they mean.


+-------------------------------+---------------------------------------------------------------------------------------------------------+
| Rule | Meaning |
+-------------------------------+---------------------------------------------------------------------------------------------------------+
| Not started | The experiment has not been started, so the allocation groups are not determined yet |
| Holdout | The user is in a holdout that this experiment references, so they are not in the experiment |
| Layer Assignment | The user is not allocated to this experiment because they are bucketed to a different part of the Layer |
| Targeting Gate/Inline Targeting | The user does not meet the requirements for the targeting gate or inline targeting |
| Not Allocated | The user is not allocated to this experiment because they do not meet the rollout % |
| {group name}{override name} | The user was forcefully bucketed into a given group by an experiment override |
| {group name} | The user was bucketed into this experiment group |
| Abandoned | "Make Decision" selected the control group. This experiment has been abandoned. |
| {group name} (Launched) | "Make Decision" selected this group as the launch group, so the user is seeing the launched experience. |
+-------------------------------+---------------------------------------------------------------------------------------------------------+
| Rule | Meaning |
| --- | --- |
| Not started | The experiment has not been started, so the allocation groups are not determined yet |
| Holdout | The user is in a holdout that this experiment references, so they are not in the experiment |
| Layer Assignment | The user is not allocated to this experiment because they are bucketed to a different part of the Layer |
| Targeting Gate/Inline Targeting | The user does not meet the requirements for the targeting gate or inline targeting |
| Not Allocated | The user is not allocated to this experiment because they do not meet the rollout % |
| `{group name}{override name}` | The user was forcefully bucketed into a given group by an experiment override |
| `{group name}` | The user was bucketed into this experiment group |
| Abandoned | "Make Decision" selected the control group. This experiment has been abandoned. |
| `{group name}` (Launched) | "Make Decision" selected this group as the launch group, so the user is seeing the launched experience. |
3 changes: 2 additions & 1 deletion integrations/data-imports/bigquery.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ or `statsig_events_signal` for events. For example, once all of your metrics dat
Statsig expects you to load data in order. For example, if you have loaded up to `2022-04-01` and signal that `2022-04-03` has landed,
we will wait for you to signal that `2022-04-02` has landed, and load that data before we ingest data from `2022-04-03`

<Note> This ingestion pipeline is in beta, and does not currently support automatic backfills or updates to data once it's been ingested. Only signal these tables
<Note>
This ingestion pipeline is in beta, and does not currently support automatic backfills or updates to data once it's been ingested. Only signal these tables
are loaded after you've run data quality checks!
</Note>

Expand Down
3 changes: 2 additions & 1 deletion integrations/data-imports/snowflake.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ or `statsig_events_signal` for events. For example, once all of your metrics dat
Statsig expects you to load data in order. For example, if you have loaded up to `2022-04-01` and signal that `2022-04-03` has landed,
we will wait for you to signal that `2022-04-02` has landed, and load that data before we ingest data from `2022-04-03`

<Note> This ingestion pipeline is in beta, and does not currently support automatic backfills or updates to data once it's been ingested. Only signal these tables
<Note>
This ingestion pipeline is in beta, and does not currently support automatic backfills or updates to data once it's been ingested. Only signal these tables
are loaded after you've run data quality checks!
</Note>

Expand Down
5 changes: 3 additions & 2 deletions snippets/ai-sdks/programmatic-eval.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ With programmatic evaluation, you can:

The evaluation automatically sends results to Statsig, where you can view them in the console alongside your other eval data.

<Note> Tasks and scorers can be async functions. Data can also be provided as async functions, promises, or async iterators.
The `expected` field in data records is optional - scorers can evaluate outputs without expected values.
<Note>
Tasks and scorers can be async functions. Data can also be provided as async functions, promises, or async iterators.
The `expected` field in data records is optional - scorers can evaluate outputs without expected values.
Task and scorer errors are automatically caught and reported in the results.
</Note>