feat(core): [NT-3533] Migrate Experience API to v3 - #487
Draft
Samuel Durkin (FailedSitcom) wants to merge 14 commits into
Draft
Samuel Durkin (FailedSitcom) wants to merge 14 commits into
Samuel Durkin (FailedSitcom) wants to merge 14 commits into
Conversation
…longside spaceId Moves ExperienceApiClient from v2/organizations/:clientId/environments/:environment paths to v3/spaces/:spaceId/environments/:contentfulEnvironment, splitting the prior single "environment" concept into the Contentful-space contentfulEnvironment (used by the v3 Experience API) and the Ninetailed/Optimization environment (still used only by the v1 Insights API). Restores clientId as a required top-level config field alongside spaceId, since both are distinct required identifiers for different APIs. Expands the Change union beyond VariableChange to include ExperienceChange and FragmentChange, drops the now-unused alias/group event schemas, and narrows ResponseEnvelope's error shape accordingly. Updates the shared mock handlers and e2e-web URL helper to the v3 route shape so downstream consumers exercise the real contract. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…Base CoreBase now destructures clientId and contentfulEnvironment from config and forwards them into the ApiClientConfig it builds for ApiClient, matching the api-client's v3 Experience API contract. ConsentPolicy's UNLOCKING_EVENT_TYPES drops the retired group/alias event types, and FlagsResolver, applyChangeOverrides, and CoreStatefulEventEmitter narrow their handling of the expanded Change union (VariableChange | ExperienceChange | FragmentChange). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Updates the QuickJS bridge entry point to pass clientId and contentfulEnvironment through to the core SDK config alongside the existing spaceId and environment fields, so native Android/iOS hosts can supply all four values. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Updates the node-sdk's ContentfulOptimization examples, dev server, README, and tests to include clientId and contentfulEnvironment alongside spaceId and environment, since these flow through unchanged from CoreConfig. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…g fields Updates the react-native-sdk's examples, dev harness env config, and tests to include spaceId and contentfulEnvironment alongside clientId and environment, since these flow through unchanged from CoreConfig. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…d tests Adds spaceId to BoundNextjsOptimizationAnalyticsRootProps' Omit list alongside clientId, since the App Router request-scoped wrapper supplies both from the resolved server config. Updates the affected app-router, pages-router, and edge test suites accordingly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…elds Updates the react-web-sdk's README, dev app, error messages, and tests to include spaceId and contentfulEnvironment alongside clientId and environment, since these flow through unchanged from CoreConfig. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ibutes Mirrors the existing client-id/environment attribute pattern on ContentfulOptimizationRootElement for space-id and contentful-environment: observed attributes, paired property accessors, and validation in createConfig (space-id is now required alongside client-id). Updates web-sdk examples, dev harness, and tests to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…onfig Adds spaceId (required) and contentfulEnvironment (default "master") to the Kotlin OptimizationConfig data class and its toJSON() serialization, alongside the existing clientId and environment, matching the bridge and core SDK contract. Updates the client init log line, README examples, and config tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds spaceId (required) and contentfulEnvironment (default "master") to the Swift OptimizationConfig struct and its toJSON() serialization, alongside the existing clientId and environment, matching the bridge and core SDK contract. Updates the client init log line, README/CODE_MAP examples, and config tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ields Updates every reference implementation that constructs an SDK config (android-sdk, ios-sdk, all nextjs-sdk variants, node-sdk, node-sdk+web-sdk, react-native-sdk, react-web-sdk, web-sdk, web-sdk_angular, web-sdk_react) to supply spaceId alongside clientId, and contentfulEnvironment alongside environment, matching the v3 Experience API contract each SDK's config now requires. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…onment split Updates authoring fragments, concept docs, integration guides, and internal SDK-knowledge files to reflect the v3 Experience API contract: spaceId and clientId are both required top-level config fields, and environment (Ninetailed/Optimization, used by the Insights API) is now distinct from contentfulEnvironment (Contentful space environment, used by the Experience API). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
allowBuilds.core-js was left as an unresolved placeholder value ("set this to
true or false") instead of true, unlike every other implementation's
pnpm-workspace.yaml. This causes pnpm install to fail with
ERR_PNPM_IGNORED_BUILDS whenever core-js is a resolved dependency, blocking the
pre-push implementation:install hook.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-sdk_react react-web-sdk had the same unresolved allowBuilds.core-js placeholder as node-sdk+web-sdk, and web-sdk_react had no allowBuilds block at all. Both resolve core-js as a dependency, so pnpm install fails with ERR_PNPM_IGNORED_BUILDS, blocking the pre-push implementation:install hook. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Body:
Summary
v3/spaces/{spaceId}/...) while restoringclientIdas a required top-level config field, distinct fromspaceId:spaceIddrives the v3 Experience API path,clientIdremains required by the Insights ingest API (v1/organizations/{clientId}/...).clientIdandcontentfulEnvironmentthroughcore-sdk, the bridge, and every platform SDK (Node, React Native, Web, Android, Swift), with matching test and documentation updates.implementations/*/pnpm-workspace.yamlbuild-approval gaps (node-sdk+web-sdk,react-web-sdk,web-sdk_react) that were silently blockingcore-jsbuild scripts and breaking the pre-push hook'simplementation:installstep.Test plan
pnpm lint/pnpm implementation:lintpnpm typecheckpnpm test:unitpnpm android:test/pnpm ios:test— confirm native config/serialization changesclientId+spaceIdconstruction against a real space/org in at least one implementation🤖 Generated with Claude Code