vuestorefront / vue-storefront

Alokai is a Frontend as a Service solution that simplifies composable commerce. It connects all the technologies needed to build and deploy fast & scalable ecommerce frontends. It guides merchants to deliver exceptional customer experiences quickly and easily.
https://www.alokai.com
MIT License
10.59k stars 2.08k forks source link

Is there a way to configure a different environment on Contentful? #6696

Closed Fedeorlandau closed 2 years ago

Fedeorlandau commented 2 years ago

What is your question / Please describe your issue

We're managing multiple environments on Contentful and looks like there is no way to configure a different environment rather than master.

https://contentful.github.io/contentful.js/contentful/9.1.18/

image

VSF-Entreprise Contentful docs: https://docs.vuestorefront.io/contentful/guide/installation.html

Using: "@vsf-enterprise/contentful": "^0.3.2",

cc @ritz0106

What version of Vue Storefront are you using?

2.3.3

Code of Conduct

lukasborawski commented 2 years ago

@Fedeorlandau Hello. From version 0.3.4 you can set the environment through the CF integration API. Cheers.

Fedeorlandau commented 2 years ago

Hi there, thank you!

Fedeorlandau commented 2 years ago

@lukasborawski what do you think of moving the environment selection to the middleware config?

module.exports = {
  integrations: {
    cntf: {
      location: '@vsf-enterprise/contentful/server',
      configuration: {
        token: 'CONTENT_DELIVERY_TOKEN',
        space: 'CONTENT_SPACE_ID',
        environment: 'master',
      },
    },
    // ... other configs
  },
}

It's a little bit annoying to do it on the search function. There could be a fair reason to do it but just asking :)

Cheers,