Vue Storefront is now Alokai! Learn More
Configuring Alokai

Configuring Alokai

Before configuring your Alokai app, it's necessary to configure BigCommerce first. If you haven't done this yet, see the Configuring BigCommerce guide.

Set up environment variables

Alokai application is using following environment variables to create a connection with BigCommerce API:

Environment variableDescription
BIGCOMMERCE_API_CLIENT_IDClient ID obtained during creating an API account
BIGCOMMERCE_API_CLIENT_SECRETClient secret obtained during creating an API account
BIGCOMMERCE_API_URLAPI path obtained during creating an API account
BIGCOMMERCE_API_ACCESS_TOKENAccess token obtained during creating an API account
BIGCOMMERCE_STORE_IDstore_hash included in API path between /stores/ and /v3/
BIGCOMMERCE_STORE_GUEST_TOKENPreview code from Review & test your store block
DEFAULT_CHANNEL_IDchannel_id of the default storefront
API_BASE_URLUrl to the API
GRAPHQL_MAX_RETRYNumber of allowed retries for graphql requests

Cookies (optional)

Some cookies are set by the middleware server and are out of the theme scope, therefore we introduce the possibility to customize its options. To override the default cookie options you must use the cookie name as a key and CookieOptions as a configuration object. The list of cookies set by the server:

customer-data - token cookie

// middleware.config.js
module.exports = {
  integrations: {
    bigcommerce: {
      configuration: {
        cookie_options: { // optional cookie options field
          'customer-data': { // cookie name
            httpOnly: true, 
            secure: true,
            sameSite: 'lax'
          }
        },
      }
    }
  }
};