This repository was archived by the owner on Sep 11, 2025. It is now read-only.
feat: Add support for passing in environment variables to the WASM module #831
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We do not yet have a way to pass in environment variables to the WASM module running the app. That is possible only for variables used in a Modus connection, where you could pass variables with the format
MODUS_<CONNECTION NAME>_<KEY>, but within the app code users write, that is not accessible, as it's only accessible on the Runtime, and not passed down to the WASM module.This PR improves this by passing in all environment variables prefixed with
MODUS_to the WASM module, so that the Modus app code can read it. Note that theMODUS_prefix will be stripped before being passed in.This also implies that if you have a connection secret
MODUS_DGRAPH_API_KEYfor example, then that would be passed to the WASM module asDGRAPH_API_KEY.Checklist
All PRs should check the following boxes:
Conventional Commits syntax, leading with
fix:,feat:,chore:,ci:, etc.the contributing guide.
If the PR includes a code change, then also check the following boxes. (If not, then delete the
next section.)
CHANGELOG.mdfile.