Fix component by passing AGENTMAIL_API_KEY using standard Convex recomendations - #5
Closed
nicu-chiciuc wants to merge 5 commits into
Closed
nicu-chiciuc wants to merge 5 commits into
nicu-chiciuc wants to merge 5 commits into
Conversation
nicu-chiciuc
commented
Sep 10, 2026
| const component = defineComponent("agentmail"); | ||
| const component = defineComponent("agentmail", { | ||
| env: { | ||
| AGENTMAIL_API_KEY: v.optional(v.string()), |
Author
There was a problem hiding this comment.
thoretically here we chould/should make it non-optional
nicu-chiciuc
marked this pull request as ready for review
September 10, 2026 14:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes credential access inside the AgentMail component.
Component functions [do not inherit the app’s environment variables](https://docs.convex.dev/components/authoring#environment-variables), so
AGENTMAIL_API_KEYandAGENTMAIL_BASE_URLmust be declared and explicitly bound.The component now reads these through the generated typed
envexport, and the README/example show the required bindings.The app-side client (in AgentMail) retains
process.env, which is supported for [client wrappers running in the app’s environment](https://docs.convex.dev/components/authoring#wrapping-the-component-with-client-code).Although its current role might be confusing since it's checking env of the parent app which might not be correct.
Verified the package build and authenticated inbox listing through a real Convex development deployment. Two example type errors under Convex 1.45 remain in the unchanged context helper types.