We have a number of package components for lightning communities and would like to improve their experience in the community builder. Many of these components depend on a certain context (url parameters for example) and when we are in the builder that context does not exist.
Is there a supported way to detect that we are in the community builder so that we can serve up dummy data to give the admin a better preview? The only option I see is to look for the
--sitepreview url portion but this seems like it might change in the future or have permutations I am not aware of with different My Domain setups. I know the Napili community app itself has a number of pseudo-documented properties like the search context so maybe this is one of them and I just can't find it?
We don't want to serve dummy data when the context is null because this could happen on the live site where we want to instead show an error.