Create Twitter/X Feed

User Intent

"How do I sync tweets from Twitter/X? Show me Twitter feed configuration."

Operation

SDK Method: createFeed() with FeedTypes.Twitter Auth: Twitter API credentials


Code Example (TypeScript)

import { Graphlit } from 'graphlit-client';
import { FeedTypes, TwitterListingTypes } from 'graphlit-client/dist/generated/graphql-types';

const graphlit = new Graphlit();

const feed = await graphlit.createFeed({
  name: 'Tech News',
  type: FeedTypes.Twitter,
  twitter: {
    type: TwitterListingTypes.Posts,
    userName: 'graphlit',
    token: process.env.TWITTER_BEARER_TOKEN!,
    readLimit: 100,
    includeAttachments: true,
  },
  // Optional: add workflow for content processing
  // workflow: { id: workflow.createWorkflow.id }
});

Configuration

username: Twitter handle (without @) readLimit: Number of tweets includeReplies: Include reply tweets includeRetweets: Include retweets


Last updated

Was this helpful?