Skip to content

Updated SUGCON sites to Content-SDK v2#585

Open
robearlam wants to merge 4 commits intomainfrom
sugcon-csdk-v2
Open

Updated SUGCON sites to Content-SDK v2#585
robearlam wants to merge 4 commits intomainfrom
sugcon-csdk-v2

Conversation

@robearlam
Copy link
Copy Markdown
Member

Summary

Upgrades the Sugcon2024 headapp from Sitecore Content SDK v1.x to v2.0,
following the official upgrade guide.

Breaking changes addressed

Area Before After
Analytics packages @sitecore-cloudsdk/core + @sitecore-cloudsdk/events @sitecore-content-sdk/analytics-core + events + personalize
SDK init CloudSDK().addEvents().initialize() initContentSdk({ config, plugins })
Next.js middleware src/middleware.ts (named export middleware) src/proxy.ts (default export proxy)
Middleware classes *Middleware (e.g. LocaleMiddleware) *Proxy (e.g. LocaleProxy)
Edge hostname env var SITECORE_EDGE_URL NEXT_PUBLIC_SITECORE_EDGE_PLATFORM_HOSTNAME
Personalize timeout env vars PERSONALIZE_MIDDLEWARE_* PERSONALIZE_PROXY_*
Next.js version ^15.5.9 ^16.1.1
Node.js types ^22 ^24

Files changed

  • package.json — dependency updates
  • src/Bootstrap.tsx — new initContentSdk initialisation
  • src/middleware.tssrc/proxy.ts — renamed + updated
  • src/components/content-sdk/CdpPageView.tsx — updated import
  • src/byoc/index.tsx — updated events import
  • sitecore.config.ts.example — updated env var names
  • .env.remote.example — added new env vars, renamed existing ones

Testing

  • tsc --noEmit passes with zero errors
  • Adversarial review performed by Claude Opus 4.6 and GPT 5.4; one
    build-breaking issue (BotTrackingProxy from unreleased SDK branch)
    and one env var misalignment were caught and resolved

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Upgrades the Sugcon2024 headapp to Sitecore Content SDK v2, aligning analytics/events initialization and request-time Edge behavior with the v2 API and configuration conventions.

Changes:

  • Migrates browser analytics/events initialization from CloudSDK v1 to initContentSdk + plugins.
  • Replaces the previous Content SDK middleware integration with the new proxy-based integration and updated env var names.
  • Updates Next.js/TypeScript config and dependency versions to support the new SDK and framework version.

Reviewed changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
headapps/Sugcon2024/tsconfig.json Updates TS resolution/JSX settings for the upgraded Next.js/SDK stack.
headapps/Sugcon2024/src/proxy.ts Introduces the new Content SDK v2 proxy pipeline (locale/multisite/redirects/personalize).
headapps/Sugcon2024/src/middleware.ts Removes the prior middleware-based implementation.
headapps/Sugcon2024/src/components/content-sdk/CdpPageView.tsx Switches page view event import to the new events package.
headapps/Sugcon2024/src/components/basic-components/content-block/ContentBlock.tsx Changes export to remove withDatasourceCheck wrapper.
headapps/Sugcon2024/src/byoc/index.tsx Updates events import to the new events package.
headapps/Sugcon2024/src/Bootstrap.tsx Migrates SDK initialization to initContentSdk with analytics/events plugins.
headapps/Sugcon2024/sitecore.config.ts.example Updates env var names and Personalize timeout keys for v2.
headapps/Sugcon2024/package.json Upgrades Next.js and switches dependencies to Content SDK v2 packages.
headapps/Sugcon2024/package-lock.json Locks the upgraded dependency tree for Content SDK v2/Next 16.
headapps/Sugcon2024/next-env.d.ts Changes how route types are referenced (now via .next/dev/...).
headapps/Sugcon2024/.sitecore/component-map.ts Adjusts component map metadata for client/server component behavior (Form marked client).
headapps/Sugcon2024/.env.remote.example Renames/adds env vars for Edge hostname + Personalize proxy timeouts.
Files not reviewed (1)
  • headapps/Sugcon2024/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 17 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • headapps/Sugcon2024/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants