Create Trello Feed
User Intent
Operation
Code Example (TypeScript)
import { Graphlit } from 'graphlit-client';
import {
FeedTypes,
FeedServiceTypes,
TrelloTypes,
} from 'graphlit-client/dist/generated/graphql-types';
const graphlit = new Graphlit();
const trelloKey = process.env.TRELLO_API_KEY!;
const trelloToken = process.env.TRELLO_TOKEN!;
// Trello doesn’t expose a helper yet, so list boards via Trello REST API
const fetchBoards = await fetch(`https://api.trello.com/1/members/me/boards?key=${trelloKey}&token=${trelloToken}`);
const boards = await fetchBoards.json();
if (!Array.isArray(boards) || boards.length === 0) {
throw new Error('No Trello boards available for the provided credentials');
}
const board = boards[0]!;
console.log(`Using Trello board: ${board.name} (${board.id})`);
const feed = await graphlit.createFeed({
name: 'Product Roadmap',
type: FeedTypes.Issue,
issue: {
type: FeedServiceTypes.Trello,
trello: {
type: TrelloTypes.Board,
identifiers: [board.id],
key: trelloKey,
token: trelloToken,
},
readLimit: 100,
includeAttachments: true,
},
// Optional: add workflow for content processing
// workflow: { id: workflow.createWorkflow.id }
});
console.log(`Created Trello feed: ${feed.createFeed.id}`);Configuration
Trello API Setup
Finding Board IDs
What Gets Synced
Use Cases
Board vs Card Sync
Related
Last updated