Create Gmail Feed
User Intent
Operation
Code Example (TypeScript)
import { Graphlit } from 'graphlit-client';
import { FeedTypes, FeedServiceTypes, EmailListingTypes } from 'graphlit-client/dist/generated/graphql-types';
const graphlit = new Graphlit();
const feed = await graphlit.createFeed({
name: 'Gmail Inbox',
type: FeedTypes.Email,
email: {
type: FeedServiceTypes.GoogleEmail,
google: {
type: EmailListingTypes.Past,
clientId: process.env.GOOGLE_CLIENT_ID!,
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
refreshToken: process.env.GOOGLE_REFRESH_TOKEN!,
readLimit: 100,
inboxOnly: true,
excludeSentItems: true
},
includeAttachments: true,
},
// Optional: add workflow for content processing
// workflow: { id: workflow.createWorkflow.id }
});
console.log(`Created Gmail feed: ${feed.createFeed.id}`);Configuration
Gmail OAuth Setup
What Gets Synced
Filtering Examples
Related
Last updated