Skip to content

🔥 feat(cda): Add managed entry fetching#350

Draft
Charles Hudson (phobetron) wants to merge 1 commit into
mainfrom
NT-3558_managed-cda-client
Draft

🔥 feat(cda): Add managed entry fetching#350
Charles Hudson (phobetron) wants to merge 1 commit into
mainfrom
NT-3558_managed-cda-client

Conversation

@phobetron

@phobetron Charles Hudson (phobetron) commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Note

Proposal. This PR is not final API approval.

Summary

Adds SDK-managed Contentful entry fetching across the Optimization SDK suite, allowing consumers to pass an entryId instead of manually fetching a baseline entry before optimization resolution.

Changes

  • Adds optional contentful SDK configuration for a Contentful client, default query options, per-instance caching, and cache clearing.
  • Adds fetchContentfulEntry() and fetchOptimizedEntry() APIs, including stateless request locale fallback and selected-optimization reuse.
  • Introduces shared optimized-entry source coordination and resolved-entry metadata.
  • Updates React Web and React Native OptimizedEntry APIs to support either baselineEntry or SDK-managed entryId fetching.
  • Adds loading/error handling and resolved-entry callbacks for managed entry flows.
  • Extends web components with managed entry-id support, entryQuery, loading/error events, and metadata in resolved events.
  • Updates Next.js server helpers so ServerOptimizedEntry can consume a managed fetch result directly.
  • Refreshes docs and package READMEs for the new integration path.
  • Adds and expands unit coverage for core fetching, framework hooks/components, web components, and Next.js server rendering.

Breaking changes

No runtime breaking changes are expected for standard SDK consumers. Existing baselineEntry usage remains supported.

Potential TypeScript-only impacts for advanced/custom integrations:

  • Custom SDK mocks or injected presentation-layer SDK objects must include fetchContentfulEntry().
  • Code extending or declaration-merging OptimizedEntryProps may need adjustment because the props now model either baselineEntry or entryId.
  • Code explicitly annotating UseOptimizedEntryResult may need to handle managed-fetch loading/error states where entry can be temporarily undefined.

[NT-3558]

Add Core `contentful` configuration, cached `fetchContentfulEntry()`, and `fetchOptimizedEntry()` APIs for stateful and request-bound stateless SDK flows.

Introduce shared entry-source lifecycle support and optimized-entry metadata so Web Components, React Web, React Native, and Next.js helpers can resolve entries from `entryId`/`entryQuery` while preserving the manual `baselineEntry` path.

Update tests, package docs, integration guides, and reference-implementation guidance for the new managed fetching surface.

[[NT-3558](https://contentful.atlassian.net/browse/NT-3558)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant