refactor: replace Strapi fetch with @strapi/client and add configurable CMS URL#5835
Merged
vineethasok merged 8 commits intomainfrom Mar 26, 2026
Merged
refactor: replace Strapi fetch with @strapi/client and add configurable CMS URL#5835vineethasok merged 8 commits intomainfrom
vineethasok merged 8 commits intomainfrom
Conversation
Introduce @strapi/client and wire up live CMS fetching across the site. IntegrationGrid: add Strapi client, types for v5/v4 responses, mapping/transform functions, use live CMS collection for integrations, switch base host to cms.clickhouse.com, enable CMS endpoint, and fall back to existing static data. DocItem TOC: replace manual fetch with strapi client single('docs-ad').find() and normalize ad attributes. package.json and yarn.lock updated to include @strapi/client (and its deps).
Introduce a reusable Strapi client hook and wire it into components. Added src/lib/useStrapiClient.ts which reads strapiUrl/strapiToken from docusaurus customFields and returns a memoized client and base URL. Updated locale docusaurus.config.* files to expose strapiUrl and strapiToken. Refactored IntegrationGrid to use the new hook, pass the Strapi base URL into transformCMSData for image URLs, and simplify fallback/CMS fetch logic. Refactored DocItem TOC (desktop) to use the hook and implement a module-level cached ad with simplified state and localStorage close handling. Also added packageManager to package.json and updated yarn.lock (dependency bumps).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
Blargian
reviewed
Mar 24, 2026
Refactor the Strapi query in useCMSIntegrations to request only required fields (name, slug, category, supportLevel, docsLink), populate logo and logo_dark with just their url attributes, and add pagination (pageSize: 500). This reduces payload size and ensures the integrations list is fetched completely. Also update static/integrations-fallback.json to match the adjusted CMS response shape.
Delete the packageManager entry that specified "yarn@4.13.0" and adjust the trailing commas in the resolutions block to preserve valid JSON. This removes an explicit package manager version from the repository configuration.
Rebuild yarn.lock to reconcile resolved dependency versions. Notable adjustments include multiple @algolia packages switched to older 5.20.x/5.47.x releases, @babel packages pinned to 7.26.x series, and several @argos-ci packages reverted/normalized (cli/core/util/playwright). This commit only updates the lockfile to reflect the current dependency resolution.
Blargian
reviewed
Mar 25, 2026
Co-authored-by: Shaun Struwig <41984034+Blargian@users.noreply.github.com>
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.
Summary
src/lib/useStrapiClient.ts— a shared React hook that builds and memoizes a@strapi/clientinstance usingCLIENT_STRAPI_URLandCLIENT_STRAPI_TOKENfrom the DocusauruscustomFields. Defaults tohttps://staging-cms.clickhouse.com.strapiUrlandstrapiTokentocustomFieldsin all 5 locale configs, populated fromCLIENT_STRAPI_URL/CLIENT_STRAPI_TOKENenv vars at build time.IntegrationGridto useuseStrapiClient, removes the old Strapi v4attributesformat handling (transformFallbackData,CMSIntegrationDataV4), and uses the dynamic base URL for logo URLs.DocItemTOC/Desktopto useuseStrapiClient, replaces 5 separate ad state vars with a singleadobject, fixes theuseEffectdependency array, removes the redundanttypeof windowSSR guard, adds unmount cancellation, and replaces localStorage ad caching with a module-level variable (survives client-side navigation, resets on hard reload).Environment variables
CLIENT_STRAPI_URL/api)https://staging-cms.clickhouse.comCLIENT_STRAPI_TOKENProd build example: