Deploy your site
Hosting Requirements
You can host a React Bricks website almost anywhere.
You only need a hosting environment capable of running Node.js (to build the website, for Static Site Generation or to build pages at runtime, for Server Side Rendering). Any hosting platform such as Netlify, Vercel, AWS, Azure will work perfectly.
Environment variables
React Bricks needs 2 environment variables. These are typically stored in your local .env
file and must be set in the hosting provider’s environment variables:
APP_ID
: This variable must be accessible by the browser and is used by the Admin interface.API_KEY
: This is the secret API_KEY which should not be exposed to the browser.
To expose the APP_ID
variable to the browser, use NEXT_PUBLIC_APP_ID
for Next.js and GATSBY_APP_ID
for Gatsby.
Build Hooks
Providers like Netlify or Vercel, which connect to your Github or Bitbucket repo, can trigger a rebuild when you push changes to the repo. However, this doesn’t address changes in CMS content.
Most providers allow you to create a Build hook—a URL that, when called (typically via HTTP POST), triggers a site rebuild.
React Bricks allows the Admin to set up two deploy hooks for an App: one for the Production environment and one for Staging (plus a third “Development” hook in case of Enterprise plans).
These can be configured from the React Bricks Dashboard.
The Admin can grant Editors permission to trigger Development, Staging or Production deploys by simply clicking a button in the App Settings interface.
Events hook
For Enterprise plan, you can also provide an Events web hook that will receive a notification for each event of pages (creation, update, delete, etc.), with a proper payload for each type of action. In this way you can implement a logging system or react to actions in an external application.