To use Trello with V0 by Vercel, generate a kanban board UI in V0, then create a Next.js API route at app/api/trello/route.ts that calls the Trello REST API using your API key and token. Store TRELLO_API_KEY and TRELLO_TOKEN in Vercel environment variables. You can fetch boards, lists, and cards to build custom project management dashboards that go far beyond Trello's default interface.
Building a Custom Trello Kanban Dashboard with V0
Trello's default interface is great for simple project management, but many teams need a customized view — a dashboard that filters only certain boards, shows metrics alongside cards, or integrates Trello data with other tools. V0 by Vercel lets you generate exactly that: a polished Next.js kanban interface that reads directly from your Trello workspace via the official REST API.
The integration works by creating a Next.js API route that acts as a secure proxy between your frontend and Trello's API. Trello uses a straightforward key-and-token authentication system — your API key identifies your application, and a token grants access to your Trello data. Both credentials stay on the server inside Vercel's environment variable system, so they never appear in your frontend JavaScript.
With this setup you can fetch all your boards and their lists, read and create cards, move cards between columns, add comments, and update due dates — all from a custom UI that you control. This tutorial walks you through generating the UI in V0, wiring up the API route, securing your credentials, and deploying to Vercel.
Integration method
V0 generates the kanban board UI with drag-and-drop columns and cards. You add a Next.js API route that calls the Trello REST API server-side, keeping your API key and token secure. The frontend fetches boards, lists, and cards from your API route to display real Trello data.
Prerequisites
- A V0 account at v0.dev — the free tier is sufficient for this tutorial
- A Trello account at trello.com with at least one board and a few cards
- Your Trello API key from https://trello.com/app-key
- A Trello token generated from the API key page (click the Token link on the same page)
- A Vercel account (free) connected to your V0 project for environment variable storage and deployment
Step-by-step guide
Generate the Kanban Board UI in V0
Generate the Kanban Board UI in V0
Open V0 at v0.dev and start a new project. In the chat prompt, describe a kanban board layout with multiple columns. Be specific about the visual design: column headers with card counts, draggable card items with titles and labels, and a clean Tailwind-based layout. V0 will generate a React component using shadcn/ui and Tailwind CSS out of the box. At this stage, use static mock data — hardcode a few boards and cards in the component props so you can see and refine the layout before connecting to real data. Once the preview looks right, switch to V0's Design Mode (Option+D) to adjust colors, spacing, and typography without spending any credits. Pay attention to how V0 structures the props for the board data — you want an interface that accepts boards, lists, and cards as nested objects. If V0 generates a flat structure, send a follow-up prompt asking it to accept a hierarchical data structure. The goal of this first step is a pixel-perfect kanban UI that you can drop Trello data into later. V0's Tailwind output is production-ready, so what you see in the preview is what your users will see on Vercel.
Create a kanban board with three columns side by side in a horizontal scrollable layout. Each column has a header with column name and a card count badge. Below the header, render a vertical list of cards. Each card is a white rounded rectangle with a subtle shadow, showing a card title in bold, an optional description in smaller gray text, and a colored label dot in the top-right corner. Add a plus icon at the bottom of each column to hint at adding new cards. Use Tailwind CSS for all styling. The component should accept a board prop: { columns: [{ id, name, cards: [{ id, title, desc, labelColor }] }] }.
Paste this in V0 chat
Pro tip: Use V0's Design Mode (Option+D) to adjust colors and spacing for free — no credits are consumed for visual tweaks.
Expected result: A styled kanban board with mock data renders in the V0 preview. Columns show card counts, and individual cards display titles with colored label dots.
Get Your Trello API Key and Token
Get Your Trello API Key and Token
Before writing any backend code, you need to collect your Trello credentials. Trello uses a two-part authentication system: an API key that identifies your application, and a token that grants access to your account's data. To get your API key, go to https://trello.com/app-key while logged into Trello. You'll see your API key displayed at the top of the page — it looks like a 32-character alphanumeric string. Copy and save it. Below the API key, click the Token link to generate an access token. Trello will ask you to authorize the application — click Allow. You'll be shown a long token string. Copy this as well. Note: the token shown on this page grants full read and write access to your Trello account, so treat it like a password. Never paste it into your V0 chat prompt or your source code. If you want to limit access to read-only or to specific boards, Trello's OAuth flow supports scopes and expiry, but for a personal project the simple key-and-token approach works fine. You can also create Power-Up developer API keys via https://trello.com/power-ups/admin for more control. Once you have both credentials, you're ready to configure your Vercel environment variables and write the API route.
Pro tip: The token generated from the app-key page never expires by default. If you want it to expire after 30 days for extra security, add ?expiration=30days to the token generation URL.
Expected result: You have two strings saved: a 32-character TRELLO_API_KEY and a longer TRELLO_TOKEN. Neither has been pasted into any code file or V0 chat message.
Create the Trello API Route
Create the Trello API Route
In V0's code editor, create a new file at app/api/trello/route.ts. This file exports a GET handler that fetches boards and their cards from the Trello REST API. The Trello API base URL is https://api.trello.com/1. All endpoints accept key and token as query parameters — you append them to every request using your server-side environment variables. For the boards list endpoint, the URL is https://api.trello.com/1/members/me/boards?key={key}&token={token}&fields=name,id,url. For a specific board's lists with nested cards, use https://api.trello.com/1/boards/{boardId}/lists?key={key}&token={token}&cards=open&card_fields=name,desc,labels,due,idMembers. The API returns JSON directly — no SDK is required, just the built-in fetch function. In your API route, read TRELLO_API_KEY and TRELLO_TOKEN from process.env, construct the URL, call fetch, parse the JSON, and return it with Response.json(). For creating cards, add a POST handler that reads the request body and calls the Trello cards endpoint. Always validate that the required fields are present before forwarding to Trello to avoid exposing Trello's raw error messages to your frontend. Keep the API key and token entirely inside this server-side route — they should never appear in any client component.
Update the kanban board component to fetch data from GET /api/trello?boardId={boardId} on mount using useEffect. Show a loading skeleton while fetching. Map the response lists to columns and the nested cards to the card items. Display an error message if the fetch fails.
Paste this in V0 chat
1import { NextRequest } from 'next/server';23const TRELLO_KEY = process.env.TRELLO_API_KEY!;4const TRELLO_TOKEN = process.env.TRELLO_TOKEN!;5const BASE = 'https://api.trello.com/1';67export async function GET(request: NextRequest) {8 const { searchParams } = new URL(request.url);9 const boardId = searchParams.get('boardId');1011 if (!boardId) {12 // Return all boards for the authenticated member13 const res = await fetch(14 `${BASE}/members/me/boards?key=${TRELLO_KEY}&token=${TRELLO_TOKEN}&fields=name,id,url`15 );16 const boards = await res.json();17 return Response.json(boards);18 }1920 // Return lists with nested open cards for a specific board21 const res = await fetch(22 `${BASE}/boards/${boardId}/lists?key=${TRELLO_KEY}&token=${TRELLO_TOKEN}&cards=open&card_fields=name,desc,labels,due,idMembers`23 );24 const lists = await res.json();25 return Response.json(lists);26}2728export async function POST(request: NextRequest) {29 const { listId, name, desc, due } = await request.json();3031 if (!listId || !name) {32 return Response.json({ error: 'listId and name are required' }, { status: 400 });33 }3435 const params = new URLSearchParams({36 key: TRELLO_KEY,37 token: TRELLO_TOKEN,38 idList: listId,39 name,40 ...(desc && { desc }),41 ...(due && { due }),42 });4344 const res = await fetch(`${BASE}/cards`, {45 method: 'POST',46 headers: { 'Content-Type': 'application/x-www-form-urlencoded' },47 body: params.toString(),48 });4950 const card = await res.json();51 return Response.json(card, { status: res.ok ? 201 : res.status });52}Pro tip: Trello's API doesn't require any SDK — plain fetch works perfectly. Avoid adding unnecessary dependencies that could slow down your Vercel cold starts.
Expected result: The file app/api/trello/route.ts exists with GET and POST handlers. Visiting /api/trello in the browser (after setting env vars) should return your Trello boards as JSON.
Add Credentials to Vercel Environment Variables
Add Credentials to Vercel Environment Variables
Your Trello API key and token must live in Vercel's environment variable system — never in your source code. If you commit these credentials to GitHub, anyone with repo access (or who finds your public repo) can read and write your entire Trello workspace. To set the variables, first connect your V0 project to GitHub using V0's Git panel, then open your Vercel project at vercel.com/dashboard. Click on your project, go to Settings, then Environment Variables. Add two variables: set TRELLO_API_KEY to your 32-character API key, and TRELLO_TOKEN to the long token string. For each variable, make sure all three environment scopes are checked: Production, Preview, and Development. Click Save after each. Important: after adding new environment variables to a Vercel project, you must trigger a new deployment for the changes to take effect — Vercel will show a banner prompting you to redeploy. For local development, create a .env.local file in the root of your project with the same two variables. Add .env.local to your .gitignore file immediately — it should already be there if you started with the default Next.js gitignore, but double-check. Never prefix these with NEXT_PUBLIC_ — these credentials are server-only and should never be sent to the browser.
1# .env.local — never commit this file to git2TRELLO_API_KEY=your_32_character_api_key_here3TRELLO_TOKEN=your_long_token_string_herePro tip: Run `vercel env pull .env.local` from your project directory to sync Vercel's Development environment variables to your local machine automatically.
Expected result: Both TRELLO_API_KEY and TRELLO_TOKEN appear in Vercel Dashboard → Settings → Environment Variables. The .env.local file exists locally but is listed in .gitignore.
Connect the Kanban UI to Live Trello Data
Connect the Kanban UI to Live Trello Data
With the API route deployed and credentials configured, wire the kanban board component to fetch real Trello data. The approach depends on what kind of page you're building. For a dashboard that shows all your boards, call GET /api/trello on the server side using a React Server Component — this eliminates loading states and gives great performance. For a single-board view that users interact with (adding cards, moving between lists), use a Client Component with useEffect for the initial fetch and SWR or React Query for background refreshing. When the user submits the card creation form, send a POST request to /api/trello with the listId, title, and optional description. After a successful POST, refetch the board data to show the new card. One important V0-specific limitation to be aware of: V0's preview sandbox cannot make outbound requests to the Trello API during development in the browser preview. The API calls will only work after you deploy to Vercel. So your development workflow should be: test the UI layout in V0 preview with mock data, then deploy to Vercel and test the live API integration there. If you're iterating quickly, use Vercel's preview deployments — every push to a branch creates a preview URL with its own environment. For complex dashboards with real-time updates (such as showing when teammates move cards), look into Trello webhooks via the https://api.trello.com/1/webhooks endpoint to push changes to your app instead of polling.
Convert the kanban board component to fetch data from GET /api/trello?boardId=YOUR_BOARD_ID inside a useEffect hook. Store the lists and cards in React state. Show a loading skeleton with three placeholder columns while fetching. When the user clicks the plus icon at the bottom of a column, show a small inline form with a text input and a Create button. On submit, call POST /api/trello with { listId, name } and refresh the board data on success.
Paste this in V0 chat
1'use client';23import { useEffect, useState } from 'react';45interface TrelloCard {6 id: string;7 name: string;8 desc: string;9 due: string | null;10 labels: { color: string; name: string }[];11}1213interface TrelloList {14 id: string;15 name: string;16 cards: TrelloCard[];17}1819export default function TrelloBoard({ boardId }: { boardId: string }) {20 const [lists, setLists] = useState<TrelloList[]>([]);21 const [loading, setLoading] = useState(true);22 const [error, setError] = useState('');2324 const fetchBoard = async () => {25 try {26 const res = await fetch(`/api/trello?boardId=${boardId}`);27 if (!res.ok) throw new Error('Failed to fetch board');28 const data = await res.json();29 setLists(data);30 } catch (err) {31 setError('Could not load board data. Check your Trello credentials.');32 } finally {33 setLoading(false);34 }35 };3637 useEffect(() => { fetchBoard(); }, [boardId]);3839 if (loading) return <div className="p-8 text-gray-500">Loading board...</div>;40 if (error) return <div className="p-8 text-red-500">{error}</div>;4142 return (43 <div className="flex gap-4 p-4 overflow-x-auto min-h-screen bg-blue-600">44 {lists.map((list) => (45 <div key={list.id} className="bg-gray-100 rounded-lg p-3 w-64 shrink-0">46 <h3 className="font-semibold text-gray-800 mb-2">47 {list.name}48 <span className="ml-2 text-xs bg-gray-300 rounded-full px-2 py-0.5">49 {list.cards.length}50 </span>51 </h3>52 <div className="space-y-2">53 {list.cards.map((card) => (54 <div key={card.id} className="bg-white rounded p-2 shadow-sm">55 <p className="text-sm font-medium text-gray-900">{card.name}</p>56 {card.due && (57 <p className="text-xs text-gray-500 mt-1">58 Due: {new Date(card.due).toLocaleDateString()}59 </p>60 )}61 </div>62 ))}63 </div>64 </div>65 ))}66 </div>67 );68}Pro tip: V0's preview sandbox cannot call external APIs like Trello during the build preview. Deploy to Vercel and test using a preview deployment URL instead.
Expected result: The deployed app fetches real Trello lists and cards and renders them in the custom kanban layout. Adding a card via the form creates it in Trello and it appears in the board after refresh.
Deploy to Vercel and Test the Integration
Deploy to Vercel and Test the Integration
With all pieces in place, deploy your project to Vercel. If you connected V0 to GitHub in an earlier step, Vercel triggers a deployment automatically on every push. You can also click Redeploy in the Vercel Dashboard. The deployment usually takes 30–60 seconds. Once the green checkmark appears, open the production URL and navigate to your Trello board page. You should see your real boards and cards rendered in the custom kanban layout. To debug any issues, go to Vercel Dashboard → your project → Functions. This tab lists all your API routes as serverless functions and shows invocation logs, error traces, and response times. If you see a 401 error from Trello, your token has expired or was entered incorrectly — regenerate it at https://trello.com/app-key and update the Vercel environment variable, then redeploy. If cards are showing but look empty, check that the card_fields parameter in your GET endpoint includes the fields you're trying to display. For teams building production Trello integrations with user authentication (where each user connects their own Trello account), RapidDev can help implement the full Trello OAuth 2.0 flow so users log in with their own credentials rather than sharing a single service token.
Pro tip: Vercel's Functions tab shows real-time logs for your API routes. If the Trello API returns an error, the raw response will appear in the function logs, making debugging much faster.
Expected result: The production Vercel URL loads your custom kanban board with real Trello data. Cards show titles and due dates. The Vercel Functions tab shows successful invocations of the /api/trello route.
Common use cases
Team Sprint Board Dashboard
Build a real-time sprint board that displays cards from a specific Trello board grouped by list, with member avatars, due date indicators, and a card count summary per column. Teams get a custom view without paying for Trello premium features.
Create a kanban board layout with three columns: To Do, In Progress, and Done. Each column shows a list of cards with a title, optional description snippet, a colored label badge, and a due date indicator that turns red when overdue. Add a column header with a card count badge. The component should accept a lists prop with array of { name, cards } objects.
Copy this prompt to try it in V0
Client Project Tracker
Create a client-facing project status page that fetches cards from a Trello board and displays them as a progress timeline. Clients can see what's been completed, what's in progress, and what's upcoming without needing a Trello account.
Build a project timeline view that shows tasks grouped by status. Use a vertical stepper layout: completed items have a green checkmark, in-progress items have a spinning indicator, upcoming items have a gray circle. Each task shows a title and optional due date. Accept a tasks prop with array of { title, status, dueDate } objects.
Copy this prompt to try it in V0
Quick Card Creation Form
Add a floating action button to any page that opens a modal for creating a new Trello card. Users select the target list from a dropdown, enter a title and optional description, and submit — the card appears in Trello instantly via the API.
Create a floating action button in the bottom-right corner that opens a modal dialog. The modal has a dropdown to select a list, a text input for card title, a textarea for description, and a date picker for due date. Add a Create Card button that calls POST /api/trello/cards with the form data and closes the modal on success.
Copy this prompt to try it in V0
Troubleshooting
API route returns 401 Unauthorized from Trello
Cause: The TRELLO_API_KEY or TRELLO_TOKEN environment variable is missing, incorrect, or was set after the last deployment without redeploying.
Solution: Go to Vercel Dashboard → your project → Settings → Environment Variables. Verify both TRELLO_API_KEY and TRELLO_TOKEN are present and correct. Then go to Deployments and click Redeploy on the latest deployment to pick up the new variables.
Board loads in development but cards are empty or missing fields
Cause: The Trello API only returns the fields you explicitly request via the card_fields query parameter. If you request a field that doesn't exist on the card, it's silently omitted.
Solution: Check your API route URL and ensure the card_fields parameter includes all fields you need. Valid values include: name, desc, due, labels, idMembers, idList, url, badges.
1// Add more fields to the card_fields parameter2`${BASE}/boards/${boardId}/lists?key=${TRELLO_KEY}&token=${TRELLO_TOKEN}&cards=open&card_fields=name,desc,labels,due,idMembers,url`Fetch to /api/trello fails in V0 preview but works after deploying
Cause: V0's browser preview sandbox cannot make outbound HTTP requests to external APIs. The API route runs correctly only on Vercel's serverless infrastructure.
Solution: This is expected behavior for V0 — use mock data to verify the UI layout in preview, then test the live Trello API integration using a Vercel preview deployment URL after pushing to GitHub.
Creating a card via POST returns 400 Bad Request
Cause: The Trello cards POST endpoint requires the name and idList fields. If either is missing or the request body format is incorrect, Trello returns a 400 with an error message.
Solution: Verify your POST handler reads listId and name from the request body and maps listId to the idList parameter. Use the URLSearchParams format shown in Step 3 — Trello's cards endpoint expects form-encoded data, not JSON.
1// Correct: send as form-encoded, not JSON2const params = new URLSearchParams({ key: TRELLO_KEY, token: TRELLO_TOKEN, idList: listId, name });3const res = await fetch(`${BASE}/cards`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: params.toString() });Best practices
- Always proxy Trello API calls through a Next.js API route — never call the Trello REST API directly from client-side React code where your token would be exposed
- Use specific card_fields and fields query parameters when calling the Trello API to reduce response payload size and speed up your dashboard
- Cache board data with a short TTL (e.g., 60 seconds using Next.js fetch caching) to avoid hitting Trello's rate limits on dashboards with multiple users
- Handle Trello's rate limit (300 requests per 10 seconds per token) by adding exponential backoff on 429 responses in your API route
- Store the boardId in your app's configuration rather than hardcoding it in the component, so you can switch boards without code changes
- For team tools where multiple users need their own Trello access, implement the full Trello OAuth 2.0 flow instead of sharing a single service token
- Add webhook support via the Trello webhooks API (/1/webhooks) to get real-time card updates instead of polling, for live collaborative dashboards
Alternatives
Asana is a better choice if your team needs broader project management features like timelines, portfolios, and workload tracking beyond Trello's pure kanban model.
ClickUp offers kanban boards plus docs, goals, and time tracking in one platform — a better fit if you want to replace multiple tools with a single integration.
Monday.com provides more structured dashboards and reporting capabilities, making it a stronger choice for teams that need executive-level project visibility.
Frequently asked questions
Does V0 have built-in Trello support?
V0 can generate kanban UI components that visually resemble Trello, but it has no native Trello integration. You need to add a Next.js API route that calls the Trello REST API yourself. This tutorial covers the complete setup. V0 does not include any Trello SDK or connector by default.
How do I find my Trello board ID?
Open your Trello board in the browser. The URL looks like https://trello.com/b/ABC12345/board-name — the short alphanumeric string after /b/ is your board ID. You can also call GET /api/trello (without a boardId parameter) using the code in Step 3 to get a list of all your boards with their IDs returned as JSON.
Will my Trello token expire?
By default, tokens generated from the Trello app-key page never expire. If you want a token that expires for security purposes, add ?expiration=30days or ?expiration=never to the token generation URL before clicking Allow. If a token is compromised, you can revoke it by going to your Trello account settings under Apps and API Access.
Can I move cards between lists with the Trello API?
Yes. Use the PUT /1/cards/{cardId} endpoint and update the idList field to the destination list's ID. Add a PATCH handler to your API route at app/api/trello/route.ts that accepts cardId and targetListId, then calls the Trello update endpoint. You can pair this with a drag-and-drop library like dnd-kit in your V0-generated component for a smooth UX.
Why does my board load in development but not in the V0 preview?
V0's browser-based preview sandbox cannot make outbound API calls to services like Trello. The preview is great for checking UI layout and styling, but the actual Trello data fetching only works when the app is deployed to Vercel. Use mock data for UI development in V0 preview, then test the live integration on your Vercel deployment URL.
Can I connect multiple Trello boards or workspaces?
Yes. The Trello API token grants access to all boards in your account. Your GET endpoint already returns all boards when called without a boardId parameter. Build a board selector in your V0 UI that lists all boards and lets users pick one, storing the selected boardId in React state or URL parameters.
How do I handle Trello's rate limits?
Trello allows 300 requests per 10 seconds per token. For most apps this is not a concern. If you're building a high-traffic dashboard, add a caching layer: use Next.js's built-in fetch caching with revalidate: 60 in your API route to cache responses for 60 seconds. For high-volume production apps, Trello offers higher rate limits for Power-Ups — apply at https://developer.atlassian.com/cloud/trello/.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation