@assemblyline-agents/gmail
v4.0.0
Published
Official Assembly Line direct Gmail API connection plugin.
Downloads
1,240
Maintainers
Readme
@assemblyline-agents/gmail
Official Assembly Line Gmail connection plugin.
It exposes Gmail threads, messages, attachments, drafts, and sends through a reviewed direct Gmail REST API connection. Gmail authorization is stored independently from Google Calendar and Google Drive. The package exports defineGmailConnection(options).
Install
npm install @assemblyline-agents/gmailCreate a Google OAuth web client, enable the Gmail API, and set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET. Optionally set GOOGLE_REDIRECT_URI or GMAIL_API_BASE_URL. Assembly Line runs Authorization Code + PKCE, requests offline access, and stores the refreshable grant host-side. New connections enable reviewed Gmail tools without requiring an approval surface. Set access: "approval-required" if drafts and sends should pause for approval, or access: "read-only" to request only gmail.readonly.
Gmail connections also expose the reviewed email.received event. Enable the
Gmail API and Pub/Sub API, then set GOOGLE_CLOUD_PROJECT,
GMAIL_PUBSUB_TOPIC, and a stable random
GMAIL_PUBSUB_VERIFICATION_TOKEN. The operator owns the Pub/Sub resources:
- Create the topic in
GOOGLE_CLOUD_PROJECT. - Grant
serviceAccount:[email protected]theroles/pubsub.publisherrole on that topic. - Run
assembly-line connections wireafter deployment and create a Pub/Sub push subscription for the reported callback URL. Append?token=<GMAIL_PUBSUB_VERIFICATION_TOKEN>using the actual secret value.
Assembly Line uses the user's existing Gmail OAuth grant only to create and
renew users.watch; it never needs a Google Cloud service-account key and does
not create or delete operator-owned Pub/Sub resources. Notifications are
expanded through Gmail History into one stable event per newly received
message; sent mail, drafts, spam, and trash are excluded. Add an explicit
automations/*.ts event automation to start agent work.
Part of Assembly Line
This package is part of Assembly Line. See the developer documentation for setup, agent authoring, and deployment guides.
License
MIT
