Skip to content

Add Unity Feature Flags Documentation#35341

Draft
typotter wants to merge 12 commits intomasterfrom
tyler.potter/unity-feature-flags-docs
Draft

Add Unity Feature Flags Documentation#35341
typotter wants to merge 12 commits intomasterfrom
tyler.potter/unity-feature-flags-docs

Conversation

@typotter
Copy link
Contributor

@typotter typotter commented Mar 17, 2026

What does this PR do? What is the motivation?

This PR adds comprehensive Unity Feature Flags documentation with two implementation options to support both the current direct API and a potential future OpenFeature integration.

Documentation Added:

  1. Direct FlagsClient API (unity.md) - Primary documentation showing the current implementation:

    • Uses DdFlags.CreateClient() and direct FlagsClient methods
    • Synchronous flag evaluation (GetBooleanValue, GetStringValue, etc.)
    • Simpler API without async/await
    • Preview URL: /feature_flags/client/unity/
  2. OpenFeature Integration (unity-openfeature.md) - Alternative documentation for future consideration:

    • Uses OpenFeature Api.Instance.GetClient()
    • Async flag evaluation methods
    • Standards-based approach
    • Preview URL: /feature_flags/client/unity-openfeature/

Both pages include cross-links for easy navigation between implementations.

Additional Changes:

  • Unity card added to feature flags client navigation
  • Documentation follows the structure of Android/iOS feature flags docs
  • Comprehensive sections: installation, SDK initialization, enable flags, create client, set evaluation context, evaluate flags (boolean, string, integer, double, object), flag evaluation details, and advanced configuration
  • All code examples use C# with proper Unity conventions

Merge instructions

Merge readiness:

  • Ready for merge

This PR is a draft for review and preview. Please review both documentation versions in the preview environment before marking as ready to merge.

Additional notes

Files Changed:

  • content/en/feature_flags/client/unity.md (266 lines)
  • content/en/feature_flags/client/unity-openfeature.md (278 lines)
  • layouts/partials/feature_flags/feature_flags_client.html (Unity card added to navigation)

@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
Contributor

github-actions bot commented Mar 17, 2026

Preview links (active after the build_preview check completes)

New or renamed files

typotter added 10 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
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant