diff --git a/docs/server-core/_sampleApp.mdx b/docs/server-core/_sampleApp.mdx new file mode 100644 index 000000000..9b2047b64 --- /dev/null +++ b/docs/server-core/_sampleApp.mdx @@ -0,0 +1 @@ +> 💡 **Tip:** Get started quickly with one of our [sample apps](https://github.com/statsig-io/statsig-server-core/tree/main/examples)! diff --git a/docs/server-core/dotnetCoreSDK.mdx b/docs/server-core/dotnetCoreSDK.mdx index 90157374b..1ff6d0406 100644 --- a/docs/server-core/dotnetCoreSDK.mdx +++ b/docs/server-core/dotnetCoreSDK.mdx @@ -12,11 +12,13 @@ import { HOOK__SDKDocUpdate, } from "../sdks/_SDKDocsBuilder.mdx"; +import SampleTipText from "./_sampleApp.mdx"; + import * as _Notes from "./dotnet-core/_notes.mdx"; export const Notes = _Notes; -import Install from "./dotnet-core/_install.mdx" -import Initialize from "./dotnet-core/_initialize.mdx" +import Install from "./dotnet-core/_install.mdx"; +import Initialize from "./dotnet-core/_initialize.mdx"; import CheckGate from "./dotnet-core/_checkGate.mdx"; import GetFeatureGate from "./dotnet-core/_getFeatureGate.mdx"; import GetConfig from "./dotnet-core/_getConfig.mdx"; @@ -91,11 +93,16 @@ export const Builder = SDKDocsBuilder({ LocalOverridesSection, { addedInVersion: "1.0.0", snippet: }, ], - [ManualExposuresSection, { addedInVersion: "1.0.0", snippet: }], + [ + ManualExposuresSection, + { addedInVersion: "1.0.0", snippet: }, + ], [Notes, {}], - ] + ], }); -export const toc = Builder.toc + + +export const toc = Builder.toc; <>{Builder.result} diff --git a/docs/server-core/elixir-core.mdx b/docs/server-core/elixir-core.mdx index 1c7298cd3..de3901828 100644 --- a/docs/server-core/elixir-core.mdx +++ b/docs/server-core/elixir-core.mdx @@ -12,6 +12,8 @@ import { HOOK__SDKDocUpdate, } from "../sdks/_SDKDocsBuilder.mdx"; +import SampleTipText from "./_sampleApp.mdx"; + import { Repository, GettingStarted, @@ -24,10 +26,9 @@ import { PersistentStorage, DataStore, OutputLogger, - ObservabilityClient + ObservabilityClient, } from "./Templates/index.mdx"; - import Preamble from "./_preamble.mdx"; import Install from "./elixir/_install.mdx"; import Initialize from "./elixir/_initialize.mdx"; @@ -40,7 +41,6 @@ import MoreFAQs from "./elixir/_faqs.mdx"; import Options from "./elixir/_options.mdx"; import ShutdownSnippet from "./elixir/_shutdown.mdx"; - export const Builder = SDKDocsBuilder({ sections: [ [ @@ -72,15 +72,16 @@ export const Builder = SDKDocsBuilder({ [StatsigUser, {}], [StatsigOptions, { options: }], [Shutdown, { shutdown: }], - [PersistentStorage, { }], - [DataStore, { }], - [OutputLogger, { }], - [ObservabilityClient, { }], + [PersistentStorage, {}], + [DataStore, {}], + [OutputLogger, {}], + [ObservabilityClient, {}], [FAQ, { faqs: }], - ] -}) + ], +}); -export const toc = Builder.toc + -<>{Builder.result} +export const toc = Builder.toc; +<>{Builder.result} diff --git a/docs/server-core/go-core.mdx b/docs/server-core/go-core.mdx index d7ac5d258..cfdf7d864 100644 --- a/docs/server-core/go-core.mdx +++ b/docs/server-core/go-core.mdx @@ -12,6 +12,8 @@ import { HOOK__SDKDocUpdate, } from "../sdks/_SDKDocsBuilder.mdx"; +import SampleTipText from "./_sampleApp.mdx"; + import { Repository, GettingStarted, @@ -75,19 +77,20 @@ export const Builder = SDKDocsBuilder({ }, ], [ManualExposures, { ...ManualExposureSnippets }], - [StatsigUser, { }], + [StatsigUser, {}], [StatsigOptions, { options: }], [Shutdown, { shutdown: , flush: }], [LocalOverrides, { snippet: }], - [PersistentStorage, { }], - [DataStore, { }], - [OutputLogger, { }], - [ObservabilityClient, { }], + [PersistentStorage, {}], + [DataStore, {}], + [OutputLogger, {}], + [ObservabilityClient, {}], [FAQ, { faqs: }], - ] -}) + ], +}); -export const toc = Builder.toc + -<>{Builder.result} +export const toc = Builder.toc; +<>{Builder.result} diff --git a/docs/server-core/index.mdx b/docs/server-core/index.mdx index 457a0ad14..b3d3611b9 100644 --- a/docs/server-core/index.mdx +++ b/docs/server-core/index.mdx @@ -7,17 +7,22 @@ last_update: date: 2025-09-18 --- +import SampleTipText from "./_sampleApp.mdx"; + ## Statsig Server Core Statsig Server Core is our second generation of Server SDKs: a full rewrite with a shared, performance-focused core library that enables superior across-the-board perf and feature maturity across our Server SDKs. Server Core SDKs include: + - **Faster Evaluation:** A shared, performance-focused Rust evaluation engine, that evaluates 3-5x as our pure native code SDKs. -- **Superior non-eval performance:** more efficient network and CPU usage, plus other performance optimizations always arriving to each SDK. -- **Features new to Server SDKs:** Parameter Stores, Contextual Multi-Armed Bandits, and more. +- **Superior non-eval performance:** more efficient network and CPU usage, plus other performance optimizations always arriving to each SDK. +- **Features new to Server SDKs:** Parameter Stores, Contextual Multi-Armed Bandits, and more. - **Quality-of-life improvements from certain SDKs:** Observability Interface, streaming config changes (from the Statsig Forward Proxy) and more ### Availability across SDKs -Server Core SDKs are available on an opt-in basis, with native SDKs still available and supported in all languages. If you're just getting started with Statsig, we recommend choosing a Server Core SDK if its convenient for you, but we continue to support bug fixes in our [Legacy SDKs](/server-core/legacy-sdks), and will until we set end-of-support dates for these SDKs. At that time - we'll also provide guidance to make migration as easy as possible. +Server Core SDKs are available on an opt-in basis, with native SDKs still available and supported in all languages. If you're just getting started with Statsig, we recommend choosing a Server Core SDK if its convenient for you, but we continue to support bug fixes in our [Legacy SDKs](/server-core/legacy-sdks), and will until we set end-of-support dates for these SDKs. At that time - we'll also provide guidance to make migration as easy as possible. + + - **[Node](./node-core)**: Stable, [npm](https://www.npmjs.com/package/@statsig/statsig-node-core) - **[Python](./python-core)**: Stable, [PyPI](https://pypi.org/project/statsig-python-core/) @@ -25,22 +30,22 @@ Server Core SDKs are available on an opt-in basis, with native SDKs still availa - **[PHP](./php-core)**: Stable, [Packagist](https://packagist.org/packages/statsig/statsigsdk) - **[Rust](./rust-core)**: Stable, [Crates.io](https://crates.io/crates/statsig-rust) - **[Elixir](./elixir-core)**: Stable -- **[.NET](./dotnetCoreSDK)**: Beta -- **Ruby**: In Development, planned for Summer 2025 +- **[.NET](./dotnetCoreSDK)**: Stable +- **Ruby**: In Development, planned for Late 2025 - **[Go](./go-core)**: Beta -- **C#**: In Development, planned for Summer 2025 ### Technical differences **Build process:** Statsig Server Core uses a core library written in Rust, with bindings written to other languages. In the vast majority of cases, this results in an unchanged development experience with superior performance, but given that the Rust code must compile into a binary usable in your development and deployment environments, some development snafus exist: - - **Choosing the right build:** In most cases, the SDK's package manager will automatically install the versions you need. The notable exception is in Java - where our SDK will print out the right build for you, if it's not included at runtime. - - **Managing lockfiles:** If your deployment and development environments require different builds (as is common), you'll want to include both versions in a lockfile like package-lock.json. - - **Untested environments:** Certain environments, like the edge, aren't friendly to this new build process - and for now, we recommend using our [native SDKs](/server-core/legacy-sdks) for the time being. + +- **Choosing the right build:** In most cases, the SDK's package manager will automatically install the versions you need. The notable exception is in Java - where our SDK will print out the right build for you, if it's not included at runtime. +- **Managing lockfiles:** If your deployment and development environments require different builds (as is common), you'll want to include both versions in a lockfile like package-lock.json. +- **Untested environments:** Certain environments, like the edge, aren't friendly to this new build process - and for now, we recommend using our [native SDKs](/server-core/legacy-sdks) for the time being. **New Configuration Spec:** Server Core uses a smaller "ruleset", or configuration spec. If you use the spec directly, your logic and parsing will have to change. **Event Logging** -Server core SDKs, starting in v0.4.0+, have a new event logging architecture. This is designed to stream events freely to statsig servers during normal operation, and throttle/drop events SDK side during outages on the event logging endpoint to enable the service to spin up healthy before processing steady-state qps. We expose the following parameters to tune this implementation +Server core SDKs, starting in v0.4.0+, have a new event logging architecture. This is designed to stream events freely to statsig servers during normal operation, and throttle/drop events SDK side during outages on the event logging endpoint to enable the service to spin up healthy before processing steady-state qps. We expose the following parameters to tune this implementation ``` - event_logging_max_queue_size: Controls batch size (default 2000). Note that exceeding the backend request size limit (10MB) will drop requests diff --git a/docs/server-core/java-core.mdx b/docs/server-core/java-core.mdx index eb28858ca..5cfb98e33 100644 --- a/docs/server-core/java-core.mdx +++ b/docs/server-core/java-core.mdx @@ -12,6 +12,8 @@ import { HOOK__SDKDocUpdate, } from "../sdks/_SDKDocsBuilder.mdx"; +import SampleTipText from "./_sampleApp.mdx"; + import { Repository, GettingStarted, @@ -30,7 +32,7 @@ import { DataStore, OutputLogger, ObservabilityClient, - FieldsNeededMethods + FieldsNeededMethods, } from "./Templates/index.mdx"; import Preamble from "./_preamble.mdx"; @@ -57,7 +59,6 @@ import ObservabilityClientContent from "./java/_observability_client.mdx"; import SharedInstanceSnippet from "./java/_sharedInstance.mdx"; import DataStoreContent from "./java/_data_store.mdx"; - export const Builder = SDKDocsBuilder({ sections: [ [ @@ -92,27 +93,38 @@ export const Builder = SDKDocsBuilder({ [StatsigUser, { statsigUser: }], [StatsigOptions, { options: }], [Shutdown, { shutdown: , flush: }], - [LocalOverrides, { snippet: ,},], - [PersistentStorage, { }], + [LocalOverrides, { snippet: }], + [PersistentStorage, {}], [DataStore, { content: }], - [OutputLogger, { }], + [OutputLogger, {}], [ObservabilityClient, { content: }], - [FAQ, { - faqs: <> - -

Java Core vs Legacy Java SDK

- -

Supported OS and Architecture Combinations

- -

Sample App

- - - }], + [ + FAQ, + { + faqs: ( + <> + +

+ Java Core vs Legacy Java SDK +

+ +

+ Supported OS and Architecture Combinations +

+ +

Sample App

+ + + ), + }, + ], [Reference, { snippets: }], [FieldsNeededMethods, {}], - ] -}) + ], +}); + + -export const toc = Builder.toc +export const toc = Builder.toc; <>{Builder.result} diff --git a/docs/server-core/node-core.mdx b/docs/server-core/node-core.mdx index 0f8e70c43..d3fb454a6 100644 --- a/docs/server-core/node-core.mdx +++ b/docs/server-core/node-core.mdx @@ -8,6 +8,8 @@ import { HOOK__SDKDocUpdate, } from "../sdks/_SDKDocsBuilder.mdx"; +import SampleTipText from "./_sampleApp.mdx"; + import { Repository, GettingStarted, @@ -110,6 +112,8 @@ export const Builder = SDKDocsBuilder({ ], }); + + export const toc = Builder.toc; <>{Builder.result} diff --git a/docs/server-core/php-core.mdx b/docs/server-core/php-core.mdx index f38d4ea3d..d55624187 100644 --- a/docs/server-core/php-core.mdx +++ b/docs/server-core/php-core.mdx @@ -12,6 +12,8 @@ import { HOOK__SDKDocUpdate, } from "../sdks/_SDKDocsBuilder.mdx"; +import SampleTipText from "./_sampleApp.mdx"; + import { Repository, GettingStarted, @@ -26,7 +28,7 @@ import { DataStore, OutputLogger, ObservabilityClient, - CustomAdapters + CustomAdapters, } from "./Templates/index.mdx"; import Preamble from "./_preamble.mdx"; @@ -69,19 +71,20 @@ export const Builder = SDKDocsBuilder({ hideAsyncDisclaimer: true, }, ], - [StatsigUser, { }], + [StatsigUser, {}], [StatsigOptions, { options: }], - [CustomAdapters, { }], + [CustomAdapters, {}], [Shutdown, { shutdown: , flush: }], - [PersistentStorage, { }], - [DataStore, { }], - [OutputLogger, { }], - [ObservabilityClient, { }], - [FAQ, { }], - ] -}) + [PersistentStorage, {}], + [DataStore, {}], + [OutputLogger, {}], + [ObservabilityClient, {}], + [FAQ, {}], + ], +}); -export const toc = Builder.toc + -<>{Builder.result} +export const toc = Builder.toc; +<>{Builder.result} diff --git a/docs/server-core/python-core.mdx b/docs/server-core/python-core.mdx index 6bd25f1dd..3ea1f634b 100644 --- a/docs/server-core/python-core.mdx +++ b/docs/server-core/python-core.mdx @@ -12,6 +12,8 @@ import { HOOK__SDKDocUpdate, } from "../sdks/_SDKDocsBuilder.mdx"; +import SampleTipText from "./_sampleApp.mdx"; + import { Repository, GettingStarted, @@ -119,6 +121,8 @@ export const Builder = SDKDocsBuilder({ ], }); + + export const toc = Builder.toc; <>{Builder.result} diff --git a/docs/server-core/rust-core.mdx b/docs/server-core/rust-core.mdx index 95f3339a5..b0af0cb0f 100644 --- a/docs/server-core/rust-core.mdx +++ b/docs/server-core/rust-core.mdx @@ -12,6 +12,8 @@ import { HOOK__SDKDocUpdate, } from "../sdks/_SDKDocsBuilder.mdx"; +import SampleTipText from "./_sampleApp.mdx"; + import { Repository, GettingStarted, @@ -28,10 +30,9 @@ import { ObservabilityClient, Reference, FieldsNeededMethods, - EventSubscriptions + EventSubscriptions, } from "./Templates/index.mdx"; - import Preamble from "./_preamble.mdx"; import Install from "./rust/_install.mdx"; import Initialize from "./rust/_initialize.mdx"; @@ -55,8 +56,6 @@ import PersistentStorageContent from "./rust/_persistent_storage.mdx"; import * as ReferenceSnippets from "./rust/_reference.mdx"; import EventSubscriptionsSnippet from "./rust/_eventSubscriptions.mdx"; - - export const Builder = SDKDocsBuilder({ sections: [ [ @@ -99,10 +98,11 @@ export const Builder = SDKDocsBuilder({ [FAQ, { faqs: }], [Reference, { snippets: }], [FieldsNeededMethods, {}], - ] -}) + ], +}); -export const toc = Builder.toc + -<>{Builder.result} +export const toc = Builder.toc; +<>{Builder.result} diff --git a/docs/server/phpSDK.mdx b/docs/server/phpSDK.mdx index 7be5bf6d1..b92b54278 100644 --- a/docs/server/phpSDK.mdx +++ b/docs/server/phpSDK.mdx @@ -77,10 +77,9 @@ export const Builder = SDKDocsBuilder({ [ShutdownSnippet, {}], [FAQ, { faqs: }], [Reference, { snippets: }], - ] -}) + ], +}); -export const toc = Builder.toc +export const toc = Builder.toc; <>{Builder.result} -