Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undocumented variable in .env.template #131

Open
lopesra opened this issue Dec 22, 2023 · 2 comments
Open

Undocumented variable in .env.template #131

lopesra opened this issue Dec 22, 2023 · 2 comments

Comments

@lopesra
Copy link

lopesra commented Dec 22, 2023

When setting up the .env configuration, its template contains the parameter NUXT_PRIVATE_REMOTES={ "media": {"id": "xxxxxxxx-xxxx-xxxx-xxxxxxxx", "locale": "en_GB"} }. Unfortunately the documentation doesn't tell how this parameter is supposed to be setup.

@neo-reply-kevin
Copy link

Bump!

@lopesra did you figure this out already?

@nico-mcalley
Copy link
Collaborator

Hey Rafael and Kevin
I hope you're both fine.
I don't know why this issue hasn't been answered for almost a year, but I hope it hasn't been blocking you since!

This line suggests, that the example projects runtime configuration can handle values for remotes as string and as object:
https://github.com/e-Spirit/crownpeak-pwa-template/blob/main/utils/fsxa.ts#L313

runtimeConfig.private.remotes
      ? typeof runtimeConfig.private.remotes === 'string'
        ? JSON.parse(runtimeConfig.private.remotes)
        : runtimeConfig.private.remotes
      : {}

So without further verification I'd say, both examples should work.
NUXT_PRIVATE_REMOTES={ "media": {"id": "xxxxxxxx-xxxx-xxxx-xxxxxxxx", "locale": "en_GB"} }
NUXT_PRIVATE_REMOTES="{ \"media\": {\"id\": \"xxxxxxxx-xxxx-xxxx-xxxxxxxx\", \"locale\": \"en_GB\"} }"

Please note:

  • This project is just an example and is meant to be customized.
  • There is no general answer here, as your project might use a different solution for parsing runtime configuration.
  • All remote projects are using the FSXARemoteApiConfig.apikey, so the key needs to have read permissions for those projects.

Please let us know, when you could solve the issue and how you did it.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants