Last updated

FTW Environment configuration variables

Reference documentation for environment variables in Flex Template for Web (FTW).

Table of Contents

The following configuration variables can be set to control the Flex template app behaviour. Most of them have defaults that work for development environment. For production deploys most should be set.



    See the How to set up Mapbox for FTW guide for more information.


    See the How to use Google Maps in FTW guide for more information.


    Your application's client ID. You can get this from Flex Console.


    Your application's client secret. It's related to client ID and used for privileged transitions from server side. You can get this from Flex Console.


    Stripe publishable API key for generating tokens with Stripe API. Use test key (prefix pk_test_) for development. The secret key needs to be added to Flex Console.


    The currency used in the Marketplace as ISO 4217 currency code. For example: USD, EUR, CAD, AUD, etc.


    Canonical root url of the marketplace. Needed for social media sharing, SEO optimization, and social logins. Note, that the value should not include a trailing slash.


    Node env. Use 'development' for development and 'production' for production.

  • PORT

    Port for server to accept connections.


    A more fine grained env definition than NODE_ENV. Is used for example to differentiate envs in logging.


    Redirect HTTP to HTTPS?


    Set when running the app behind a reverse proxy, e.g. in Heroku or Render.


    See the How to set up Sentry to log errors in FTW guide for more information.


    See the How to set up Content Security Policy (CSP) for FTW guide for more information.


    Set to enable HTTP Basic Auth.


    Set to enable HTTP Basic Auth.


    See the How to set up Analytics for FTW guide for more information.


    Enables availability calendar for listings.


    Enables default search suggestions in location autocomplete search input.


    The base url to access the Sharetribe Flex Marketplace API. FTW uses the correct one by default so no need to set this.


    App ID of a Facebook App when Facebook login is used.


    App secret of a Facebook App when Facebook login is used.

NOTE: FTW templates are built on top of Create React App (CRA). CRA uses WebpackDevServer for providing Hot Module Reloading feature. In some environments, WebpackDevServer might need some extra configurations. You should also check CRA's advanced configurations if you experience problems with socket ports.

Defining configuration

When the app is started locally with yarn run dev or yarn run dev-server, you can set environment variables by using the (gitignored) .env file. You can edit the basic variables via yarn run config or by editing directly the .env file. Some variables can be edited only in the .env file. The repository contains a template file .env-template with default configuration.

In production, it's recommended that you set the configuration via env variables and do not deploy an .env file. The client application will only be packaged with env variables that start with REACT_APP. This way server secrets don't end up in client bundles.

With deploys note that the configuration options are bundled in the client package at build time. The configuration of the build environment must match run environment for things to work consistently. To apply changes to configuration values client bundle must be rebuilt. Just restarting the server is not enough.