Three options:
- A local strapi instance:
- Start strapi locally,
- configure
.envwithCMS=STRAPIandSTRAPI_APIpointing to your local strapi instance (cp .env.example .envshould do the trick)
- Using the the deployed staging strapi instance:
- Set
STRAPI_API=<STRAPI_STAGING_URL>/apiand setSTRAPI_ACCESS_KEYto your token (create a new key in the strapi GUI at "Settings" > "API Tokens" > "Create new API Token")
- Set
- Use a local content file:
- Set
STRAPI_APIandSTRAPI_ACCESS_KEYto point to staging like in option 2. - Set
CMS=FILE - Run
pnpm run build:localContent(should have generated acontent.jsonfile)
- Set
For each Strapi page, there are two locales: Staging (sg) and Production (de). This is because while we're able to feature flag code changes in PostHog, we aren't able to feature flag content changes in the CMS. E.g. If we want to test out content changes, like different components on the same page, we must use Strapi's Locale feature, as Multi-Environments is only supported by Strapi Cloud.
The App first checks to see if valid staging data exists, and if not, pull the requested data from the production environment. By default, we develop features in the Production environment.