Create Trello Feed

User Intent

"How do I sync Trello boards and cards? Show me Trello feed configuration."

Operation

SDK Method: createFeed() with FeedTypes.Issue Auth: Trello API key and token


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

type: TrelloTypes.Board or TrelloTypes.Card identifiers: Array of board or card IDs (enumerate via Trello REST API) key: Trello API key token: Trello auth token readLimit: Maximum items to sync


Trello API Setup

  1. Get API Key: https://trello.com/app-key

  2. Generate Token: Click "Token" link on API key page

  3. Authorize your application with read access to the required boards

  4. Set TRELLO_API_KEY and TRELLO_TOKEN environment variables

  5. Call Trello’s REST API (e.g., /1/members/me/boards) to list board IDs for the feed configuration


Finding Board IDs

From Board URL:

https://trello.com/b/ABC12345/board-name
                      ^^^^^^^^
                      Board ID

Via API:

curl "https://api.trello.com/1/members/me/boards?key=YOUR_KEY&token=YOUR_TOKEN"

What Gets Synced

When syncing Boards:

  • All cards in the board

  • Card titles and descriptions

  • Lists and positions

  • Labels and due dates

  • Members and assignments

  • Comments and attachments

When syncing Cards:

  • Specific card details

  • Card checklists

  • Card activities

  • Card attachments


Use Cases

Product Management:

type: TrelloTypes.Board,
identifiers: ['product-roadmap-board-id']

Sprint Planning:

type: TrelloTypes.Board,
identifiers: ['sprint-board-id', 'backlog-board-id']

Project Tracking:

type: TrelloTypes.Board,
identifiers: ['client-projects-board-id']

Board vs Card Sync

Sync by Board (recommended):

  • Get all cards in a board

  • Easier to maintain

  • Better for team boards

Sync by Card (specific):

  • Track specific cards across boards

  • More granular control

  • Better for individual tasks


Last updated

Was this helpful?