Ability to pass env-variables to UI Extension #4248
dlhck
started this conversation in
Feature Requests
Replies: 1 comment 1 reply
|
So a really hacky way for me right now is to simply put an // ./package.json
...
"dev": "./inject-env.sh && concurrently --kill-others npm:dev:*",
...# ./inject-env.sh
#!/bin/bash
# A hacky way to add our own ENV variables to the Vendure dashboard.
source .env
VARS=$(cat <<EOF
VITE_MY_VAR="$MY_VAR"
VITE_MY_OTHER_VAR="$MY_OTHER_VAR"
EOF
)
echo "$VARS" > node_modules/@vendure/dashboard/.envI haven't tried it yet on the cloud which doesn't save an |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
Sometimes there are API Keys or other variables that you need to switch between dev/staging and production.
Currently there is no configuration that would pass variables from Plugin to it's UI.
Not talking about the customField-config that passes customField-related data.
Describe the solution you'd like
A config-field in VendurePlugin-config that would pass the other-than-custom-field-data to UI-extension provided inside that plugin.
Describe alternatives you've considered
Allow creation of separate UI-components for different environments and a config-flag that would set the environment for which the Admin UI is built.
Additional context
Related Discord-thread:
https://discord.com/channels/1100672177260478564/1281528744527528018
All reactions