Integrate Teachable with Lovable by creating an Edge Function that calls the Teachable REST API using your API key stored in Cloud → Secrets. You can build custom course storefronts, revenue dashboards, and enrollment management tools. Teachable's API covers courses, users, enrollments, and transactions — making it well-suited for creator businesses that want a branded experience beyond Teachable's default storefront.
Build custom Teachable storefronts and revenue dashboards in Lovable
Teachable is a leading course platform for creators who monetize knowledge through courses, coaching programs, memberships, and digital products. Unlike self-hosted LMS platforms, Teachable handles all the payment processing, student management, and content delivery — making it easy to launch and sell online education. Its API gives creators programmatic access to courses, users, enrollments, and transaction data, enabling custom interfaces beyond what Teachable's default school front-end provides.
The most common reasons to build on top of Teachable's API in Lovable are: creating a fully branded storefront that matches your business website without the visual constraints of Teachable's school theme system, building an admin dashboard with custom analytics (revenue by course, enrollment trends, student LTV), or integrating Teachable data into a broader business operations tool alongside CRM, email marketing, and other data sources.
Teachable's API uses simple Bearer token authentication — you include your API key as a header on every request. There is no OAuth dance, no token expiry, and no user-level auth required for most operations. The API key identifies your school and grants access to all courses and data within it. This simplicity makes Teachable one of the easier education platform APIs to integrate, with the primary complexity being correct data modeling of Teachable's enrollment and pricing structures in your Lovable app.
Integration method
Teachable does not have a Lovable shared connector. All API calls are proxied through a Deno Edge Function using your Teachable API key stored in Cloud → Secrets. The Teachable REST API uses simple Bearer token authentication — your API key is included as a header on every request, all handled server-side in the Edge Function to keep credentials out of your frontend.
Prerequisites
- A Lovable account with at least one project created and deployed
- A Teachable school account (Basic plan or above — the API may have limitations on free plans)
- Your Teachable API key from the school admin settings
- At least one published course in your Teachable school to verify the integration works
- Familiarity with Teachable's data model: schools contain courses, courses have enrollment plans, users have enrollments
Step-by-step guide
Find your Teachable API key
Find your Teachable API key
Your Teachable API key is available in your school's admin settings. It grants full access to your school's data through the API, so treat it like a password. To find your API key: Log in to your Teachable school at your school's URL (e.g., yourschool.teachable.com/sign_in). In the admin dashboard, click on your school name or the settings cog in the top-right area. Navigate to Settings (or School Settings). Look for the 'API' section — it may be in the Admin section, Integrations, or Tools depending on your Teachable version. You should see your API key displayed there. If you do not see an API section, your current Teachable plan may not include API access — Teachable's Basic plan includes API access, but free plans may not. The Teachable API key is a long alphanumeric string. Copy it carefully — you will store it in Lovable's Cloud → Secrets in the next step. The base URL for Teachable's API is https://developers.teachable.com/v1 (or check the current documentation at developers.teachable.com — Teachable has updated their API over time). Most endpoints return JSON data about your school's courses, users, and transactions.
Pro tip: Teachable's API documentation is available at developers.teachable.com. Review the available endpoints for your specific plan before building — not all data fields are available on all plan tiers.
Expected result: You have your Teachable API key. You know the base URL for Teachable's REST API. You are ready to store credentials in Lovable's Cloud → Secrets.
Store your Teachable API key in Cloud → Secrets
Store your Teachable API key in Cloud → Secrets
Store your Teachable API key in Lovable's Cloud → Secrets panel. This encrypted environment variable is accessible only from Edge Functions and never from client-side code, your GitHub repository, or chat history. In Lovable, click the '+' icon at the top of the editor next to the Preview label to open the Cloud panel. Click the Secrets tab. Click 'Add new secret' and add: - Name: TEACHABLE_API_KEY — Value: your Teachable API key The Teachable API key is all you need for authentication — it is sent as an Authorization header or an apiKey header (check your Teachable API documentation for the exact header name for your API version) on every request. Some versions of the Teachable API use: apiKey: {your_api_key} as a header. Others use Authorization: Bearer {api_key}. The Edge Function you create in the next step will handle this header correctly based on your API version. Lovable's security system blocks approximately 1,200 API keys from being hardcoded into application code per day. Using Cloud → Secrets ensures your Teachable API key never appears in frontend JavaScript, Git history, or build logs.
Pro tip: Teachable's API key provides access to all data in your school including student personal information and transaction records. Use it carefully and ensure your Lovable app's access policies (via Supabase RLS) restrict who can trigger API calls to authorized admin users only.
Expected result: TEACHABLE_API_KEY is stored in Cloud → Secrets with a masked value. The Edge Function will access it via Deno.env.get('TEACHABLE_API_KEY').
Create the Teachable API proxy Edge Function
Create the Teachable API proxy Edge Function
Build the Edge Function that proxies all requests from your Lovable frontend to the Teachable REST API. This function handles authentication by injecting your API key as a request header and routes calls to the correct Teachable endpoint. Paste this prompt into Lovable's chat: 'Create a Supabase Edge Function at supabase/functions/teachable-api/index.ts that proxies Teachable REST API requests. Accept POST requests with body { endpoint: string, method: string, body?: object, params?: object }. Read TEACHABLE_API_KEY from Deno.env. Build the request to https://developers.teachable.com/v1/{endpoint} with header apiKey: {apiKey} (the Teachable v1 API uses apiKey header not Bearer). Add params as query string for GET requests. Return the Teachable API response as JSON with CORS headers.' Teachable's REST API endpoints for the v1 API include: - GET /courses — list all courses in your school - GET /courses/{course_id} — single course details - GET /courses/{course_id}/enrollments — enrollments for a course - GET /users — list all users - GET /users/{user_id} — single user profile - GET /users/{user_id}/enrollments — courses a user is enrolled in - GET /transactions — list all transactions (purchases) Note: Teachable's API versioning and endpoint paths have changed over their history. Verify the exact base URL and auth header format against the current Teachable developer documentation before deploying. The v1 API at developers.teachable.com uses the apiKey request header, not Bearer authentication.
Create a Supabase Edge Function at supabase/functions/teachable-api/index.ts. Read TEACHABLE_API_KEY from Deno.env. Accept POST requests with body { endpoint: string, method: string, params?: object, body?: object }. Call https://developers.teachable.com/v1/{endpoint} with apiKey header set to the API key. Add params as URL query parameters for GET requests. Return the JSON response with CORS headers. Return 400 if endpoint is missing.
Paste this in Lovable chat
1// supabase/functions/teachable-api/index.ts2const corsHeaders = {3 'Access-Control-Allow-Origin': '*',4 'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',5};67Deno.serve(async (req) => {8 if (req.method === 'OPTIONS') {9 return new Response('ok', { headers: corsHeaders });10 }1112 try {13 const apiKey = Deno.env.get('TEACHABLE_API_KEY');14 if (!apiKey) {15 return new Response(16 JSON.stringify({ error: 'TEACHABLE_API_KEY not configured' }),17 { status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }18 );19 }2021 const { endpoint, method = 'GET', params, body: requestBody } = await req.json();2223 if (!endpoint) {24 return new Response(25 JSON.stringify({ error: 'endpoint is required' }),26 { status: 400, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }27 );28 }2930 let url = `https://developers.teachable.com/v1/${endpoint}`;3132 if (params && method === 'GET') {33 const queryString = new URLSearchParams(34 Object.entries(params).map(([k, v]) => [k, String(v)])35 ).toString();36 if (queryString) url += `?${queryString}`;37 }3839 const fetchOptions: RequestInit = {40 method,41 headers: {42 'apiKey': apiKey,43 'Content-Type': 'application/json',44 'Accept': 'application/json',45 },46 };4748 if (requestBody && method !== 'GET') {49 fetchOptions.body = JSON.stringify(requestBody);50 }5152 const response = await fetch(url, fetchOptions);53 const data = await response.json();5455 return new Response(JSON.stringify(data), {56 status: response.status,57 headers: { ...corsHeaders, 'Content-Type': 'application/json' },58 });59 } catch (error) {60 return new Response(61 JSON.stringify({ error: error.message }),62 { status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }63 );64 }65});Pro tip: Teachable's API is paginated with page and per parameter for most list endpoints. Add page: 1, per: 25 to your initial requests and check the meta.total and meta.number_of_pages fields in responses to determine if additional pages exist.
Expected result: The teachable-api Edge Function is deployed and visible in the Cloud tab. When called with a valid endpoint, it successfully proxies requests to the Teachable API using your API key.
Build course catalog and revenue dashboard components
Build course catalog and revenue dashboard components
With the Edge Function deployed, build React components that display Teachable data. Start with the course catalog (for the storefront use case) and revenue metrics (for the analytics use case). Paste this prompt into Lovable's chat: 'Create two React components: (1) TeachableCourseGrid: fetch all courses from the teachable-api Edge Function with endpoint courses. Display each course as a card showing: image_url, name, description (first 150 chars), heading (pricing description), and a list of price points from the course's pricing_plans. Add a direct enrollment link to {course.url} or a custom checkout flow. (2) TeachableRevenueStats: fetch recent transactions from endpoint transactions with params { page: 1, per: 100 }. Show: total revenue (sum of amounts), transactions count, and a table with columns: student name, course name, amount, and created_at date. Add a date range filter.' Teachable course objects include: id, name, description, image_url, url (the Teachable course page URL), published (boolean), free (boolean), and pricing_plans (array of plans with price and name). For revenue calculations, transaction objects include: id, amount (in cents — divide by 100 for display), created_at, user (nested object with name and email), and course (nested object with name). Build a revenue chart by grouping transactions by week or month using the created_at date. For complex multi-school Teachable setups or when you need to combine Teachable data with payment processor data from Stripe for comprehensive financial reporting, RapidDev's team can help architect the data pipeline.
Create a TeachableDashboard page with two tabs: Courses and Revenue. Courses tab: fetch all courses from teachable-api Edge Function (endpoint 'courses') and show them in a card grid with name, image, description preview, and price. Revenue tab: fetch transactions (endpoint 'transactions' with params { page: 1, per: 100 }) and show total revenue amount, transaction count, and a table with student name, course, amount formatted as USD, and date.
Paste this in Lovable chat
Pro tip: Transaction amounts from Teachable are in cents (integers). Always divide by 100 before displaying as currency: (amount / 100).toFixed(2). Use Intl.NumberFormat to format currency with the correct symbol for your school's currency.
Expected result: The dashboard shows your Teachable courses in a grid and transaction data in a revenue summary. Course prices and transaction amounts are displayed correctly formatted. The data comes from the live Teachable API.
Set up Teachable webhooks for real-time notifications
Set up Teachable webhooks for real-time notifications
Teachable sends webhooks when key events occur: new enrollments, completed purchases, user signups, and course completions. Receiving these in real time lets your Lovable app react immediately — sending a welcome email, updating a CRM, or triggering a custom onboarding flow. Paste this prompt into Lovable's chat: 'Create a Supabase Edge Function at supabase/functions/teachable-webhook/index.ts that receives Teachable webhook POST requests. Teachable does not use HMAC signing — it sends events with an object_key, event, and data payload. Parse the JSON body and handle these events: lesson_completion.new (store in a Supabase lesson_completions table), enrollment.new (store in enrollments table with course_id, student_email, enrolled_at), purchase.new (store in purchases table with amount, course_name, student_email, purchased_at). Return 200 OK for all events.' Deploy your app and note the Edge Function URL: https://[project-ref].supabase.co/functions/v1/teachable-webhook. In your Teachable admin panel, go to Settings → Integrations → Webhooks. Add your Edge Function URL as a webhook endpoint. Select the events you want to receive. Teachable webhook payloads follow the pattern: { object_key: 'enrollment', event: 'enrollment.new', data: { ... } }. The data object structure varies by event type — check Teachable's webhook documentation for the exact fields per event. Note that Teachable's webhook verification is simpler than Stripe's — there is no HMAC signature to verify. You can optionally add your own security by using a secret token as a query parameter in your webhook URL (e.g., ?token=randomSecret) and validating it in your Edge Function.
Create a Supabase Edge Function at supabase/functions/teachable-webhook/index.ts. Parse incoming POST requests from Teachable webhooks. Handle event types: enrollment.new (insert into a Supabase enrollments table with user_email, course_name, enrolled_at from the event data), purchase.new (insert into purchases table with amount_cents, course_name, user_email, purchased_at). Log unhandled event types to console. Always return HTTP 200.
Paste this in Lovable chat
Pro tip: After registering your webhook in Teachable, use the 'Send test payload' option in Teachable's webhook settings to send a test event. Check Cloud → Logs in Lovable to verify the event arrives and is processed correctly.
Expected result: The webhook Edge Function is deployed. It is registered in Teachable's webhook settings. New enrollments and purchases from Teachable create records in your Supabase tables within seconds of the transaction completing. Cloud → Logs shows incoming events.
Common use cases
Custom branded course storefront
Build a fully branded course marketplace that pulls live data from Teachable — course titles, descriptions, thumbnails, prices, and student counts — while matching your brand's design exactly. Users click through to Teachable for checkout.
Create a custom course storefront. Call the teachable-api Edge Function to fetch all published courses with their names, descriptions, thumbnails, prices, and student counts. Display them in a branded card grid with custom styling. For each course, show a pricing table if the course has multiple pricing plans. The Enroll button links to the Teachable course checkout page for that course. Add a featured courses hero section at the top with the 3 most popular courses.
Copy this prompt to try it in Lovable
Creator revenue and enrollment analytics dashboard
Build a business intelligence dashboard for course creators that shows revenue by course, enrollment trends over time, student retention metrics, and transaction history — with more flexibility than Teachable's built-in reports.
Build a creator analytics dashboard. Use the teachable-api Edge Function to fetch enrollments with date ranges and transactions with amounts. Show: total revenue this month vs last month, revenue breakdown by course as a pie chart, new enrollments per week as a line chart for the last 12 weeks, average revenue per student, and a transactions table with student name, course, amount, and date. Add filters for date range and course selection.
Copy this prompt to try it in Lovable
Student coaching portal with progress tracking
Build a personalized student portal where enrolled students see their active courses, progress status, and can communicate with their coach — supplementing Teachable's standard student dashboard with custom features.
Create a student coaching portal. Use the teachable-api Edge Function to fetch enrollments for the logged-in student (looked up by email). Show each enrolled course with: course name, thumbnail, enrollment date, and completion percentage. Add a coaching notes section (stored in Supabase, not Teachable) where coaches can leave private notes per student. Show the student's upcoming coaching session dates from a Supabase coaching_sessions table.
Copy this prompt to try it in Lovable
Troubleshooting
All Teachable API calls return 401 Unauthorized
Cause: The TEACHABLE_API_KEY secret is missing, incorrect, or the apiKey header name does not match what Teachable's API version expects.
Solution: Verify TEACHABLE_API_KEY in Cloud → Secrets matches exactly what is shown in your Teachable admin settings (no extra whitespace). Check the Teachable API documentation for your account's API version — older Teachable accounts use the apiKey header, while some newer versions use Authorization: Bearer format. Update the Edge Function's header configuration if needed. Check Cloud → Logs to see the exact error response from Teachable.
Course list returns empty array even though courses exist in Teachable
Cause: The courses endpoint requires courses to be published. Unpublished or archived courses are not returned by default.
Solution: In Teachable admin, verify your courses are published (visible to students). The GET /courses endpoint typically returns only published courses. If you need to see all courses including unpublished ones, check if your API version supports a status filter parameter or an admin-specific endpoint variant. Also verify the endpoint path — the correct path is courses (not course or v1/courses without the /v1 prefix handled by your Edge Function).
Transaction amounts look wrong — very large numbers instead of dollar amounts
Cause: Teachable stores transaction amounts in cents (integer), not as decimal dollar amounts. For example, a $49 course purchase is stored as 4900.
Solution: Divide all Teachable transaction amounts by 100 before displaying them as currency. Use Intl.NumberFormat for consistent formatting: new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(amount / 100). If you are summing amounts for revenue calculations, sum the raw cent values first, then divide by 100 at display time to avoid floating-point precision issues.
Teachable webhook events are not arriving in the Edge Function
Cause: The webhook URL in Teachable points to the Lovable preview URL instead of the deployed Edge Function URL, or the app is not deployed.
Solution: Webhook URLs must point to the deployed Supabase Edge Function URL: https://[project-ref].supabase.co/functions/v1/teachable-webhook. The Lovable preview URL cannot receive webhooks. Deploy your app via the Publish button first, then register the Edge Function URL in Teachable's webhook settings. In Teachable admin → Settings → Integrations → Webhooks, update the URL if it was set to a preview URL.
Best practices
- Store TEACHABLE_API_KEY in Cloud → Secrets and never include it in Edge Function code comments, console.log statements, or error messages that might appear in logs
- Cache frequently accessed Teachable data (course list, pricing plans) in your Supabase database with a 15-30 minute refresh interval to reduce API calls on high-traffic pages
- Always divide Teachable transaction amounts by 100 for display — store the raw cent value in Supabase if you are persisting transaction data
- Use Teachable webhooks for real-time enrollment and purchase notifications rather than polling the API — webhooks are faster and do not count against API rate limits
- Restrict API-calling Edge Functions with Supabase RLS policies to ensure only authenticated admin users can trigger calls that expose student personal data or financial information
- Implement pagination in your Teachable API calls — the default page size may not return all courses or transactions for large schools with many students
- Test the integration with a free or low-cost Teachable test course before connecting production course data — this avoids accidentally triggering real enrollment changes during development
Alternatives
Choose Thinkific if your primary use case is self-paced course delivery with a stronger free tier — Thinkific's API is comparable in scope but the platform focuses more on course content than coaching and memberships.
Choose LearnWorlds if you need stronger white-label options and built-in certificate generation — LearnWorlds offers more customization for branded learning portals than Teachable.
Choose Podia if you want to sell courses alongside digital downloads, webinars, and subscriptions from a single all-in-one storefront without managing separate tools.
Frequently asked questions
Does Teachable have a native Lovable connector?
No. Teachable is not one of Lovable's 17 shared connectors as of March 2026. You integrate it manually using an Edge Function proxy that stores your API key in Cloud → Secrets. This tutorial covers the complete setup including API proxy creation, course catalog display, revenue dashboard, and webhook handling.
Which Teachable plan includes API access?
Teachable's Basic plan and above include API access. The free Teachable plan has limitations that may include restricted or no API access. If you do not see an API section in your Teachable admin settings, check your current plan and consider upgrading. Contact Teachable support to confirm API access for your specific plan.
Can I create courses and enroll students programmatically through the Teachable API?
The Teachable API supports creating enrollments programmatically (POST /enrollments) for scenarios like bulk enrollment or integrating with external payment systems. Course creation via API has limited support — most creators use Teachable's admin interface to build courses. Check the current Teachable developer documentation for the full list of write operations available in your API version.
How does Teachable handle refunds in the API transaction data?
Refunded transactions in Teachable appear as separate refund events in the transaction history with negative amounts. When calculating total revenue from the transactions endpoint, filter out refund transactions or sum both positive and negative amounts to get net revenue. The transaction object includes a transaction_type or similar field that distinguishes purchases from refunds — check your Teachable API documentation for the exact field name.
Can I use this integration to build a white-label version of my Teachable school?
Yes, with some limitations. You can build a fully custom storefront and student dashboard on top of Teachable's API, displaying your courses and managing enrollments through your own branded interface. However, Teachable's checkout and payment processing remain on Teachable's infrastructure. For the payment flow, you either link users to Teachable's checkout page or implement a completely custom payment system (e.g., Stripe) with Teachable's free enrollment API for post-payment enrollment.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation