1

Long time Front-end specific Sitecore developer, first time question asker on this particular stack exchange.

Hopefully, the title explains what I'm after somewhat, but we currently have a Sitecore 10.3 instanced in which the front-end repo using Sitecore version 20, Next 12 and React 17 connects to.

We will be migrating to use XM Cloud, but as we transition there is a request to be able to change the SITECORE_API_KEY env variable so that we can fetch from either the 10.3 service or the XM Cloud service based on a flag provided by another 3rd party package, Launch Darkly.

As far as I'm aware, we will only have access to the decision making flag in the client, which is fine, provided that subsequent fetches went to the alternate endpoint.

Is this even the correct approach for this task? Is this task possible given we have power over the creation of the LayoutService? I am not too sure if its a non standard approach or if theres a better more supported way of achieving what I need here,

Any advice would be appreciated

1
  • Can you tell us what the use case is here? This seems like a very non-standard approach. I've not heard of anyone trying this before.
    – Richard Seal
    Commented Apr 26 at 16:10

1 Answer 1

0

I agree with this approach, and I think it makes sense to handle this logic on the client side. Migration from Sitecore 10.3 to XM Cloud can indeed be a big task, so being able to fetch from either the 10.3 service or the XM Cloud service based on a flag is a practical solution. This setup allows for a gradual transition without having to switch everything at once, keeping the implementation aligned with XM Cloud's client-driven approach.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.