You are viewing the technical documentation for Sharetribe. If you are looking for our no-code documentation, see our new help center.

Last updated

Template environment variables

Reference documentation for environment variables in the Sharetribe Web Template.

Table of Contents

You can change the following environment variables to specify API credentials or enable certain functionalities. Most have a default value that allows you to run the template locally. However, when you are ready to deploy your marketplace to production, you should reference this list of environment variables.

List of available environment variables


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


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


    Your application's client ID. You can get this from Sharetribe 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 Sharetribe 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 Sharetribe Console.


    The 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.


    Marketplace name in self-hosted marketplaces is set through environment variables. If not set, this defaults to 'Biketribe' in src/config/configDefault.js.


    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 guide for more information.


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


    Set to enable HTTP Basic Auth.


    Set to enable HTTP Basic Auth.


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


    Used to configure Plausible Analytics. Read more in how to set up analytics.


    The base url to access the Sharetribe Marketplace API. The template 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.


Used to initialize the SDK with a custom base URL. Only use this if you want to proxy asset SDK calls through your server. The template uses the correct base URL by default if left empty.

Setting environment variables

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.

Environment variables are bundled with the client during build time. If you change environment variables locally or in production, you must remember to rebuild the client bundle. In production, this means redeploying the application. Locally, you need to rerun either yarn run dev or yarn run dev-server.