CMS for Remix: content, previews and public delivery

Connect a CMS to a Remix retail site through its actual supported release, content reads and previews, then verify the approved public version.

A CMS for Remix connects editorial records to your application’s content reads and publication process. Choose the connection for the Remix generation you actually run. Then verify that editors can preview a correction privately and customers receive the approved version through the public delivery path.

Identify the Remix application

The current Remix documentation describes a full-stack TypeScript framework with imports from remix/*. Its routing and component model differ from the React-based application described in older Remix tutorials. A familiar product name does not make those tutorials interchangeable.

Inspect the deployed application’s package manifest and lockfile. Record the installed framework release and CMS-client version. Identify the server entry, runtime and hosting configuration from the deployed code. Establish whether the guide page reads content during a request, in the browser or through an additional generation step.

The Remix v2 documentation preserves its own route-module conventions and points readers towards React Router. Sanity’s maintained React Router visual-editing guide explicitly targets React Router 7.9+. Its loaders and React components belong to that integration. Treat them as a separate path from the newer Remix framework.

For the newer framework, Remix’s routing and controllers guide describes a route map and controller actions that return Web Responses. A server-side CMS read belongs in that request-handling path. This is a custom API connection using the CMS’s documented client, not an assumed native Remix connector.

Use the documentation shipped with the installed framework release when implementing the handler. An upgrade is a separate decision from connecting editorial content. A CMS tutorial is not a reason to change the application’s generation.

Read and preview the retail content

Use Sanity’s documented JavaScript client as the content-access example. It needs a Sanity project, a dataset and an installed, configured @sanity/client. Preview reads also need a server-side token with permission to read drafts. Give the application read access without granting content-write permission.

Create a hypothetical product guide called “Choosing a dining table”. Give it a stable document ID, a slug, advice sections and image references. Store catalogue product IDs alongside the editorial recommendations. Resolve price and availability through the commerce system when showing those products.

Follow Sanity’s client-query documentation for client.fetch(), query parameters and document selection. Pass the route slug as a parameter instead of inserting it into a query string. Select the guide’s ID and title together with the content the page needs.

  1. Configure the project and dataset in the server environment. Pin the API version supported by your implementation. Keep the read token outside browser configuration and generated client files.
  2. Add the guide read to the controller serving the guide URL. Use the published perspective for public requests. Render the resulting guide through the application’s existing page renderer.
  3. Handle the read outcome explicitly. Return a missing-page response when no published guide matches. A failed CMS request is a delivery failure, so return the appropriate error response instead of presenting an empty guide as a successful page.
  4. Add a separate editor-preview path. Use an authorised editor session to select draft reads with useCdn: false. Keep the public path on published content and prevent shared caching of preview responses.
  5. Publish a baseline guide, then save a recognisable draft edit. The authorised preview must show the draft. A separate customer session must still show the baseline and must fail to activate draft access.

Sanity’s framework-independent draft-mode guide documents preview activation through a validated secret and Web API endpoints. Use that procedure for the preview handshake, together with your application’s session protection. It requires a server runtime that handles requests and sets cookies, plus a token that can read the secret documents.

In an existing React Router application, use the dedicated Sanity React Router integration instead. Its preview session and loader setup are documented for that application family. Do not copy those imports into a newer Remix controller.

Verify the public policy correction

A published CMS record and a corrected public page are separate checkpoints. For the hypothetical dining-table guide, correct the wording about delivery to upstairs rooms after the policy owner approves it. Keep the same guide ID so the change can be followed through delivery.

Publish the correction and read that record through the public CMS selector. Confirm the response contains the intended wording before investigating the frontend. If it does not, check the dataset, guide ID and published state. A preview showing the correction does not establish that the public record changed.

Next, request the guide as an ordinary customer. For a request-rendered route, establish whether the handler performs a new read or receives cached content. If your architecture generates files from CMS content, follow its publication event through generation and release. Rebuilding is useful only when generated output owns the stale page.

Remix’s request-handling documentation separates the runtime boundary from routing and middleware. Inspect those layers in your deployed application. Middleware or a host cache can answer before the CMS-reading controller runs. A browser refresh alone cannot establish which layer supplied the page.

Diagnose the first mismatch in the delivery path.

  • If the CMS read fails, check the deployed environment and token permissions. Restore the intended access and repeat the same read.
  • If the CMS result is correct but the rendered page is wrong, check the selected fields and rendering logic. Confirm the route uses the guide record you inspected.
  • If the origin page is correct but the customer response is stale, inspect application and host caches. Expire the response that contains the old revision, then repeat the customer request.
  • If only connected customer assistance gives the old answer, inspect its policy source and refresh event. Updating the frontend does not prove a separate document import has refreshed.

Close the correction after the public guide gives the approved delivery answer and its product references still resolve. Keep current stock, prices and order status with their commerce owners.

Assign maintenance and recovery

Assign the content model to a schema owner who maintains field meanings and migration rules. The framework owner maintains the installed Remix release and server runtime. An integration owner maintains CMS reads, preview access and publication events. The deployment owner maintains release configuration and cache recovery.

Keep a recovery set containing the approved guide revision, its schema and referenced media. Retain the application release that can render that schema, plus its deployment configuration. Store credentials in the existing secret manager and retain their configuration names without copying values into the recovery record.

Practise restoration in a non-production environment. Restore the compatible application and content, confirm that images resolve and repeat the editor/customer separation check. Then request the public guide and compare its delivery answer with the approved policy. A previous code release alone cannot restore content that has changed independently in the CMS.

Give your store its own shopping agent

Customers ask in their own words. Your agent finds, compares and checks out from your catalogue, right on your site.

See it in actionFree trial · Simple setup