Skip to content

[DOCS-13875] Add Unity Feature Flags documentation#35341

Merged
typotter merged 18 commits intomasterfrom
tyler.potter/unity-feature-flags-docs
Apr 8, 2026
Merged

[DOCS-13875] Add Unity Feature Flags documentation#35341
typotter merged 18 commits intomasterfrom
tyler.potter/unity-feature-flags-docs

Conversation

@typotter
Copy link
Copy Markdown
Contributor

@typotter typotter commented Mar 17, 2026

What does this PR do? What is the motivation?

Fixes DOCS-13875

Adds documentation for the Datadog Feature Flags SDK for Unity (dd-sdk-unity PR #206).

Documentation added:

  • content/en/feature_flags/client/unity.md — covers the full direct IFlagsClient API:

    • Installation via EDM4U and UPM
    • DdFlags.Enable() / DdFlags.Instance.CreateClient()
    • SetEvaluationContext with targeting key and attributes
    • Typed flag evaluation: boolean, string, integer, double, object
    • FlagDetails<T> detail methods (value, variant, reason, error)
    • Advanced configuration (FlagsConfiguration constructor options)
  • Unity card added to the feature flags client navigation partial

Structure follows the iOS and Android Feature Flags doc pattern.

Merge instructions

Merge readiness:

  • Ready for merge

Additional notes

This PR is ready for technical and editorial review. The SDK PRs (#206, #210) are still open — merge readiness is gated on the SDK landing first.

Preview: https://docs-staging.datadoghq.com/tyler.potter/unity-feature-flags-docs/feature_flags/client/unity/

@github-actions github-actions Bot added the Architecture Everything related to the Doc backend label Mar 17, 2026
@typotter typotter force-pushed the tyler.potter/unity-feature-flags-docs branch from e593405 to bc89345 Compare March 17, 2026 18:48
Add comprehensive Unity Feature Flags documentation with two implementations:

1. unity.md - Direct FlagsClient API (current implementation)
   - Uses DdFlags.CreateClient() and direct FlagsClient methods
   - Synchronous flag evaluation (GetBooleanValue, GetStringValue, etc.)
   - Simpler API without async/await

2. unity-openfeature.md - OpenFeature integration (future/alternative)
   - Uses OpenFeature Api.Instance.GetClient()
   - Async flag evaluation methods
   - Standards-based approach

Both pages:
- Include cross-links to each other for easy navigation
- Follow the structure of Android/iOS feature flags docs
- Include installation, setup, evaluation, and advanced config sections
- Add Unity card to feature flags client navigation

The documentation is ready for preview and user feedback.
Replace full documentation with minimal placeholder pages to test CI:
- Keep navigation links and cross-references
- Add 'Documentation coming soon' message
- Reduce from ~270 lines to ~28 lines each
- Test if minimal changes pass all CI checks

Full documentation will be added incrementally after CI validation.
@typotter typotter force-pushed the tyler.potter/unity-feature-flags-docs branch from bc89345 to cac19fc Compare March 17, 2026 19:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 17, 2026

Preview links (active after the build_preview check completes)

New or renamed files

typotter added 13 commits March 17, 2026 13:44
…e docs

Incremental update to unity-openfeature.md:
- Add detailed Overview explaining OpenFeature integration
- Add complete Installation instructions (EDM4U, Unity package, Android setup)
- Add Initialize SDK section with reference to Unity Monitoring Setup
- Add reference links at bottom

File size: 27 → 68 lines (+41 lines)
Add back all sections to unity-openfeature.md:
- Enable flags
- Create and retrieve a client
- Set the evaluation context
- Evaluate flags (boolean, string, integer, double, object)
- Flag evaluation details
- Advanced configuration

Also fixes duplicate further_reading partial and adds
OpenFeature external link to further_reading frontmatter.
Add back all sections to unity.md:
- Overview
- Installation
- Initialize the SDK
- Enable flags
- Create and retrieve a client
- Set the evaluation context
- Evaluate flags (boolean, string, integer, double, object)
- Flag evaluation details
- Advanced configuration
Feature flags are no longer in preview. Removed the callout
from both unity.md and unity-openfeature.md to match the
other SDK pages (android, ios, javascript, react).
…section

- FlagsConfiguration is now immutable (constructor-based, not object initializer)
- Add Getting Started quickstart section to unity.md
- Fix DdFlags.Instance.CreateClient() throughout unity.md
- Update parameter names to match constructor signatures (camelCase)
- Add EvaluationFlushIntervalSeconds clamp range [1, 60] to both pages
- Revert FlagsConfiguration to object initializer syntax (mutable properties, PascalCase)
- Restore DdFlags.SetEvaluationContext() as static method (not on client)
- DdFlags.CreateClient() returns void; OpenFeature client retrieved via Api.Instance.GetClient()
- Add Getting Started quickstart section
- Restore correct advanced config property names (PascalCase)
- DdFlags is an instance class with immutable FlagsConfiguration (constructor syntax)
- DdFlags.Instance.CreateProvider() returns provider for registration with OpenFeature
- Provider registered via Api.Instance.SetProviderAsync(provider)
- Evaluation context set via OpenFeature standard EvaluationContext.Builder()
- No Datadog-specific context types or direct provider method calls
- Rename "Create and retrieve a client" section to "Register the provider"
- Evaluation context set via client.SetEvaluationContext(FlagsEvaluationContext) not OpenFeature context builder
- DdFlags.Instance.CreateClient() returns FlagsClient (held for context setting); OpenFeature client retrieved separately via Api.Instance.GetClient()
- Show Unity coroutine pattern (WaitUntil) for async flag evaluation — MonoBehaviour does not support await
- Fix named provider registration: Api.Instance.SetProviderAsync("domain", provider)
- Add Getting Started as full MonoBehaviour example
- Remove unused openfeature.dev footnote
- Merge unity.md and unity-openfeature.md into one page, OpenFeature-first
- Add aliases for old unity-openfeature URLs
- Direct FlagsClient API moved to collapsed advanced section at the bottom
- Drop FlagDetails documentation (FlagDetails<T> and FlagEvaluationError are now internal)
- Flag evaluation details section uses OpenFeature FlagEvaluationDetails types only
- Delete unity-openfeature.md and unity.md.bak
- new DatadogFeatureProvider(client) replaces DdFlags.Instance.CreateProvider()
- DatadogFeatureProvider is in separate com.datadoghq.unity.flags.openfeature package
- using Datadog.Unity.Flags.OpenFeature namespace required
- DdFlags.Instance is always non-null (static readonly singleton)
- CreateClient() returns IFlagsClient (public interface)
- FlagDetails<T> and FlagEvaluationError are public — restore detail methods in direct API section
- Installation section updated for two-package architecture and NuGetForUnity
- Remove all OpenFeature references and the openfeature package install steps
- Follow iOS page structure: Enable → Create client → Set context → Evaluate → Advanced config
- DdFlags.Enable() / DdFlags.Instance.CreateClient() / client.SetEvaluationContext()
- Synchronous typed getters: GetBooleanValue, GetStringValue, GetIntegerValue, GetDoubleValue, GetObjectValue
- FlagDetails<T> detail methods documented
- FlagsConfiguration uses constructor syntax (immutable)
- Backup of previous state at typo/unity-feature-flags-docs-openfeature-backup
@typotter typotter changed the title Add Unity Feature Flags Documentation [DOCS-XXXXX] Add Unity Feature Flags documentation Mar 31, 2026
@typotter typotter marked this pull request as ready for review March 31, 2026 16:49
@typotter typotter requested review from a team as code owners March 31, 2026 16:49
@drichards-87 drichards-87 added the editorial review Waiting on a more in-depth review label Mar 31, 2026
@drichards-87
Copy link
Copy Markdown
Contributor

Created DOCS-13881 for the editorial review.

@typotter typotter changed the title [DOCS-XXXXX] Add Unity Feature Flags documentation [DOCS-13875] Add Unity Feature Flags documentation Mar 31, 2026
Comment on lines +4 to +5
aliases:
- /feature_flags/setup/unity/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a redirect because the page never existed at this location.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, good catch!


1. Install the [External Dependency Manager for Unity (EDM4U)][1]. This can be done using [Open UPM][2].

2. Add the Datadog SDK Unity package from its Git URL at [https://github.com/DataDog/unity-package][3]. The package URL is `https://github.com/DataDog/unity-package.git`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Add the Datadog SDK Unity package from its Git URL at [https://github.com/DataDog/unity-package][3]. The package URL is `https://github.com/DataDog/unity-package.git`.
2. Add the [Datadog SDK Unity package][3] using its Git URL `https://github.com/DataDog/unity-package.git`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applied

);
{{< /code-block >}}

This method fetches flag assignments from the server asynchronously in the background. The operation is non-blocking and thread-safe. Flag updates are available for subsequent evaluations once the background operation completes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This method fetches flag assignments from the server asynchronously in the background. The operation is non-blocking and thread-safe. Flag updates are available for subsequent evaluations once the background operation completes.
This method fetches flag assignments from the server asynchronously in the background. The operation is non-blocking and thread-safe. Flag updates are available for subsequent evaluations after the background operation completes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applied


## Set the evaluation context

Define who or what the flag evaluation applies to using a `FlagsEvaluationContext`. The evaluation context includes user or session information used to determine which flag variations should be returned. Call this method before evaluating flags to ensure proper targeting.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Define who or what the flag evaluation applies to using a `FlagsEvaluationContext`. The evaluation context includes user or session information used to determine which flag variations should be returned. Call this method before evaluating flags to ensure proper targeting.
Define who or what the flag evaluation applies to using a `FlagsEvaluationContext`. The evaluation context includes user or session information used to determine which flag variations should be returned. Call this method before evaluating flags to help ensure proper targeting.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applied

- Remove /feature_flags/setup/unity/ alias (URL never existed)
- Simplify Git URL installation step wording
- ensure -> help ensure (Vale rule)
- once the -> after the (Vale rule)
@typotter typotter requested a review from joepeeples April 7, 2026 21:20
@typotter
Copy link
Copy Markdown
Contributor Author

typotter commented Apr 7, 2026

Thanks Joe for the fixes and nav-bar add. PTAL

Copy link
Copy Markdown
Contributor

@joepeeples joepeeples left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@typotter typotter merged commit 53d8922 into master Apr 8, 2026
30 of 36 checks passed
@typotter typotter deleted the tyler.potter/unity-feature-flags-docs branch April 8, 2026 19:28
StefonSimmons pushed a commit that referenced this pull request Apr 16, 2026
* Add Unity Feature Flags documentation

Add comprehensive Unity Feature Flags documentation with two implementations:

1. unity.md - Direct FlagsClient API (current implementation)
   - Uses DdFlags.CreateClient() and direct FlagsClient methods
   - Synchronous flag evaluation (GetBooleanValue, GetStringValue, etc.)
   - Simpler API without async/await

2. unity-openfeature.md - OpenFeature integration (future/alternative)
   - Uses OpenFeature Api.Instance.GetClient()
   - Async flag evaluation methods
   - Standards-based approach

Both pages:
- Include cross-links to each other for easy navigation
- Follow the structure of Android/iOS feature flags docs
- Include installation, setup, evaluation, and advanced config sections
- Add Unity card to feature flags client navigation

The documentation is ready for preview and user feedback.

* Simplify Unity Feature Flags docs to placeholders

Replace full documentation with minimal placeholder pages to test CI:
- Keep navigation links and cross-references
- Add 'Documentation coming soon' message
- Reduce from ~270 lines to ~28 lines each
- Test if minimal changes pass all CI checks

Full documentation will be added incrementally after CI validation.

* Add Overview, Installation, and Initialize SDK sections to OpenFeature docs

Incremental update to unity-openfeature.md:
- Add detailed Overview explaining OpenFeature integration
- Add complete Installation instructions (EDM4U, Unity package, Android setup)
- Add Initialize SDK section with reference to Unity Monitoring Setup
- Add reference links at bottom

File size: 27 → 68 lines (+41 lines)

* Restore full OpenFeature docs for Unity Feature Flags

Add back all sections to unity-openfeature.md:
- Enable flags
- Create and retrieve a client
- Set the evaluation context
- Evaluate flags (boolean, string, integer, double, object)
- Flag evaluation details
- Advanced configuration

Also fixes duplicate further_reading partial and adds
OpenFeature external link to further_reading frontmatter.

* Restore full Unity Feature Flags direct API documentation

Add back all sections to unity.md:
- Overview
- Installation
- Initialize the SDK
- Enable flags
- Create and retrieve a client
- Set the evaluation context
- Evaluate flags (boolean, string, integer, double, object)
- Flag evaluation details
- Advanced configuration

* Remove preview callout from Unity Feature Flags docs

Feature flags are no longer in preview. Removed the callout
from both unity.md and unity-openfeature.md to match the
other SDK pages (android, ios, javascript, react).

* Update Unity Feature Flags docs with correct API and Getting Started section

- FlagsConfiguration is now immutable (constructor-based, not object initializer)
- Add Getting Started quickstart section to unity.md
- Fix DdFlags.Instance.CreateClient() throughout unity.md
- Update parameter names to match constructor signatures (camelCase)
- Add EvaluationFlushIntervalSeconds clamp range [1, 60] to both pages

* Fix Unity OpenFeature docs to match openfeature SDK worktree

- Revert FlagsConfiguration to object initializer syntax (mutable properties, PascalCase)
- Restore DdFlags.SetEvaluationContext() as static method (not on client)
- DdFlags.CreateClient() returns void; OpenFeature client retrieved via Api.Instance.GetClient()
- Add Getting Started quickstart section
- Restore correct advanced config property names (PascalCase)

* Rewrite Unity OpenFeature docs to match intended API design

- DdFlags is an instance class with immutable FlagsConfiguration (constructor syntax)
- DdFlags.Instance.CreateProvider() returns provider for registration with OpenFeature
- Provider registered via Api.Instance.SetProviderAsync(provider)
- Evaluation context set via OpenFeature standard EvaluationContext.Builder()
- No Datadog-specific context types or direct provider method calls
- Rename "Create and retrieve a client" section to "Register the provider"

* Fix Unity OpenFeature docs to match intended API design

- Evaluation context set via client.SetEvaluationContext(FlagsEvaluationContext) not OpenFeature context builder
- DdFlags.Instance.CreateClient() returns FlagsClient (held for context setting); OpenFeature client retrieved separately via Api.Instance.GetClient()
- Show Unity coroutine pattern (WaitUntil) for async flag evaluation — MonoBehaviour does not support await
- Fix named provider registration: Api.Instance.SetProviderAsync("domain", provider)
- Add Getting Started as full MonoBehaviour example
- Remove unused openfeature.dev footnote

* Consolidate Unity Feature Flags into a single page

- Merge unity.md and unity-openfeature.md into one page, OpenFeature-first
- Add aliases for old unity-openfeature URLs
- Direct FlagsClient API moved to collapsed advanced section at the bottom
- Drop FlagDetails documentation (FlagDetails<T> and FlagEvaluationError are now internal)
- Flag evaluation details section uses OpenFeature FlagEvaluationDetails types only
- Delete unity-openfeature.md and unity.md.bak

* Remove openfeature URL aliases from Unity docs

* Update Unity Feature Flags docs for PR #210 API changes

- new DatadogFeatureProvider(client) replaces DdFlags.Instance.CreateProvider()
- DatadogFeatureProvider is in separate com.datadoghq.unity.flags.openfeature package
- using Datadog.Unity.Flags.OpenFeature namespace required
- DdFlags.Instance is always non-null (static readonly singleton)
- CreateClient() returns IFlagsClient (public interface)
- FlagDetails<T> and FlagEvaluationError are public — restore detail methods in direct API section
- Installation section updated for two-package architecture and NuGetForUnity

* Fix installation: NuGetForUnity is a transitive UPM dep, not a manual install step

* Rewrite Unity Feature Flags docs: direct API only, no OpenFeature

- Remove all OpenFeature references and the openfeature package install steps
- Follow iOS page structure: Enable → Create client → Set context → Evaluate → Advanced config
- DdFlags.Enable() / DdFlags.Instance.CreateClient() / client.SetEvaluationContext()
- Synchronous typed getters: GetBooleanValue, GetStringValue, GetIntegerValue, GetDoubleValue, GetObjectValue
- FlagDetails<T> detail methods documented
- FlagsConfiguration uses constructor syntax (immutable)
- Backup of previous state at typo/unity-feature-flags-docs-openfeature-backup

* add new Unity page to side nav

* Address joepeeples review comments on unity.md

- Remove /feature_flags/setup/unity/ alias (URL never existed)
- Simplify Git URL installation step wording
- ensure -> help ensure (Vale rule)
- once the -> after the (Vale rule)

---------

Co-authored-by: Joe Peeples <joe.peeples@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Architecture Everything related to the Doc backend editorial review Waiting on a more in-depth review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants