Is there possibility to have different source URL in Contentful App for different contentful environements?

I’d like to know if there is such a possibility so we can build an contentful app and test it in acceptance environment for eg. before go to prod.

Otherwise, it looks like multiple AppDefinitions we should create in order to provide different source url (url of source code for the specific environment), so we can test the acc version and see if it’s fine bofore apply it on prod source.

All I could find in docs is that you should provide source url in AppDefinition during app creation and app is availbale in different envs, but source then remains the same for all envs.

Thanks in advance!

1 Like

@s.ninic Yes, app definitions can only specify a single source of truth for their code. For your case, it would make sense to create a second app definition for staging purposes or local development.

You can also react to the current environment inside your app’s code using sdk.ids.environment, although that’s probably not what you’re looking for.

@fabians Thank you very much for your fast response :slight_smile:

We needed this kind of confirmation, so probably we’ll stick to having different apps for different environments as it fits to our needs.

Thanks again!