Skip to content

Configuration Options

Khalifa Lame edited this page Nov 30, 2020 · 3 revisions

Alt Storefront configuration options are controlled via a handful of easy-to-edit files.

Environment Variables

These can be configured locally by creating a .env.local file in the root of the project and editing it as needed. In production, your host will likely have a dashboard through which you can modify these options. Note: Heroku calls them "Config Vars".

API_URI

This should contain the address of your Saleor core's graphql URL. For example, http://localhost:8000/graphql/.

API_ORIGIN

This should contain the address of your Saleor core deployment. For example, http://localhost:8000/ (without /graphql at the end). This is used for letting the browser know that it should "preconnect" to your Saleor API, thereby speeding up the storefront a little.

STORAGE_ORIGIN

The address of your media files storage server. For example, an Amazon S3 bucket configured to store your Saleor images. This setting is used only for speed optimizations in the browser. It does not actually determine where your images will be loaded from. Read more about preconnecting here

SITE_NAME

Name of your store. Try to keep it short. Alt Storefront UI has not been optimized or tested for long store names.

SITE_DESCRIPTION

Description or tag line of your store. Used in the SEO metadata. This is what search engines will show as description when your site shows up in a search.

GA_CODE

Optional Google Analytics tracking code.

GTM_CODE

Optional Google Tag Manager tracking code. A sample tag manager container is included in the project root folder with full support for Google Ecommerce tracking. If used, GA_CODE is not needed.

BAIDU_CODE

Optional Baidu Analytics tracking code.

MEILISEARCH_URL

Optional MeiliSearch server URL. MeiliSearch is used to display search suggestions as the user types.

MEILISEARCH_KEY

Optional MeiliSearch API key. It is recommended to provide your MeiliSearch public key. Leave empty if no master key has been set on your MeiliSearch server.

SENTRY_DSN

Optional identifier for integrating with Sentry error monitoring tool.

PWA Options

Alt Storefront's PWA manifest is located at /public/manifest.webmanifest. For more information on PWA manifests, see https://developer.mozilla.org/en-US/docs/Web/Manifest Note that when changing theme color for the PWA, you may want to change also the theme-color meta tag contained in the site's HTML template located at /src/pages/document.ejs.

Change App Icons

The /public folder contains all the app icons. Feel free to replace them with your own. Just remember to update the link and meta tags in the HTML template if the names of the icon files are different, or if you want a different fill color. The PWA manifest file also references the app icons, it may need to be updated to reflect the new icon names.

.altrc

The .altrc.ts file located in the project root contains additional options that you may wish to customize. A default .altrc.ts file is included in the project. The demo site runs using this configuration.

Allow/Disallow Anonymous Checkout

Setting allowAnonCheckout to true will allow unregistered users to add items to their cart and checkout. Setting it to false will show a registration popup when a user tries to add items to their cart.

Home Page Layout

The Alt Storefront home page can be customized by configuring the homeLayout option. It is essentially a vertical list of the sections that make up your home page. See Customizing the Home Page for more details on this option.

Payment Gateways

Payment gateways can be configured using the paymentGateway option.