Change `apiEndpoint` in `sm.json` based on environment/branch

We are looking to have the apiEndpoint in the sm.json file be one of 2 values depending on the branch. Is there any way to do this currently?

As a workaround, we are thinking we will remove the file from version control and generate it as a build step based on the environment variables.

Hi William,

Unfortunately, this is not possible at the moment and it's not currently being worked on. Although the team are open to the discussion around this.

How would you like this to work? Maybe replace sm.json with env variables?


Appreciate the quick reply - I waited too long to check on it!

Env vars would solve this, however, the simplest and most flexible approach might be to allow either a json or js file to be consumed by next-slicezone and the slicebuilder?

No worries. I've passed your feedback to the Slice Machine team. Hopefully, they'll get back to me soon with a response about this topic.

This is being tracked as an open feature request.

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the :heart: button to show your support for the feature and check out our Feature Request Guidelines.

This is something the team really wants to implement but it’s not in the pipe right now. If you have a certain scripted flow, you can rewrite the manifest whenever necessary of course.