Skip to content

Fix component by passing AGENTMAIL_API_KEY using standard Convex recomendations - #5

Closed
nicu-chiciuc wants to merge 5 commits into
agentmail-to:mainfrom
samebase:codex-fix-component-configuration
Closed

nicu-chiciuc wants to merge 5 commits into
agentmail-to:mainfrom
samebase:codex-fix-component-configuration

Conversation

@nicu-chiciuc

Copy link
Copy Markdown

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_KEY and AGENTMAIL_BASE_URL must be declared and explicitly bound.

The component now reads these through the generated typed env export, 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.

Comment thread src/component/convex.config.ts Outdated
const component = defineComponent("agentmail");
const component = defineComponent("agentmail", {
env: {
AGENTMAIL_API_KEY: v.optional(v.string()),

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoretically here we chould/should make it non-optional

@nicu-chiciuc
nicu-chiciuc marked this pull request as ready for review September 10, 2026 14:49
@nicu-chiciuc nicu-chiciuc changed the title Pass the AGENTMAIL_API_KEY using standard Convex recomendations Fix component by passing AGENTMAIL_API_KEY using standard Convex recomendations Sep 10, 2026
@nicu-chiciuc
nicu-chiciuc deleted the codex-fix-component-configuration branch September 10, 2026 15:01
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

Successfully merging this pull request may close these issues.

1 participant