Skip to main content
RapidDev - Software Development Agency
lovable-integrationsEdge Function Integration

How to Integrate Lovable with LearnWorlds

Integrate LearnWorlds with Lovable by creating an Edge Function that uses LearnWorlds' API v2 with OAuth2 authentication, with credentials stored in Cloud → Secrets. You can build branded learning portals, certificate generation workflows, and enrollment management tools. LearnWorlds' white-label capabilities make it particularly well-suited for building fully custom branded education products on top of its infrastructure.

What you'll learn

  • How to obtain LearnWorlds API credentials from your school admin panel
  • How to store LearnWorlds credentials securely in Lovable's Cloud → Secrets
  • How to build a Deno Edge Function that proxies LearnWorlds API v2 requests
  • How to create a fully branded white-label learning portal using LearnWorlds as the backend
  • How to generate and display LearnWorlds certificates programmatically
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate15 min read50 minutesEducationMarch 2026RapidDev Engineering Team
TL;DR

Integrate LearnWorlds with Lovable by creating an Edge Function that uses LearnWorlds' API v2 with OAuth2 authentication, with credentials stored in Cloud → Secrets. You can build branded learning portals, certificate generation workflows, and enrollment management tools. LearnWorlds' white-label capabilities make it particularly well-suited for building fully custom branded education products on top of its infrastructure.

Build white-label branded learning portals on top of LearnWorlds' API

LearnWorlds differentiates itself from other course platforms with an emphasis on white-label customization, interactive video features, and professional certificate generation. It is popular with corporate training teams, coaches, and educational businesses that need a platform that disappears behind their own brand rather than prominently featuring the course platform name. Its API v2 provides programmatic access to all core data: courses, users, enrollments, products, certificates, and school settings.

For Lovable developers, LearnWorlds is an ideal backend for building fully custom educational portals where LearnWorlds handles the course player, content delivery, and certificate generation infrastructure while Lovable provides the branded marketing site, custom dashboard, and enrollment flow. Users see only your brand — not LearnWorlds — while benefiting from its video delivery, interactive content, and certificate systems.

The integration uses LearnWorlds' API key authentication (for server-to-server calls) or OAuth2 (for user-specific operations). The API key is a long-lived credential stored in Cloud → Secrets and used in every server-side request from the Deno Edge Function. The API v2 base URL is your LearnWorlds school subdomain plus /api/v2/ — making it specific to your school instance.

Integration method

Edge Function Integration

LearnWorlds does not have a Lovable shared connector. All API calls use LearnWorlds' API v2 with OAuth2 or API key authentication, proxied through a Deno Edge Function. Credentials are stored encrypted in Cloud → Secrets. LearnWorlds' API supports courses, users, enrollments, certificates, and products — enabling fully branded custom portals on top of its infrastructure.

Prerequisites

  • A Lovable account with at least one project created and deployed
  • A LearnWorlds school account (Pro plan or above — API access may require a higher plan tier)
  • Your LearnWorlds API key from your school admin panel
  • Your LearnWorlds school subdomain (the part before .learnworlds.com in your school URL)
  • At least one published course in your LearnWorlds school to test the integration

Step-by-step guide

1

Obtain your LearnWorlds API credentials

LearnWorlds API credentials are managed in your school admin panel. To find your API key: Log in to your LearnWorlds admin panel at your-school.learnworlds.com/admin. Navigate to Settings → Schools Settings → API. You will see options to generate or view your API key. If this section is not visible, your current LearnWorlds plan may not include API access — API access is available on the Pro plan and above. The API key is a long string that serves as your primary authentication credential for server-to-server API calls. Click 'Generate API Key' if one does not exist, or copy the existing key. This key is used in an Lw-Client API key header on every request. Also note your school subdomain. If your school URL is https://mycompany.learnworlds.com, your subdomain is mycompany. The API base URL for your school will be https://mycompany.learnworlds.com/api/v2 (for the REST API). For user-specific operations (like fetching individual user progress or certificates), you may also need to use LearnWorlds' user authentication tokens. However, for admin-level operations like course catalog, enrollments, and certificates, the API key is sufficient — it represents your school admin identity. LearnWorlds' API documentation is available at dev.learnworlds.com and includes Swagger/OpenAPI specifications you can explore to see all available endpoints and their request/response formats.

Pro tip: LearnWorlds API access requires at least the Pro plan. If you are on the Starter plan, you will not see the API section in Settings. Consider upgrading if this integration is critical to your use case, or contact LearnWorlds support to confirm API availability for your plan.

Expected result: You have your LearnWorlds API key and your school subdomain. These are ready to store in Lovable's Cloud → Secrets.

2

Store LearnWorlds credentials in Cloud → Secrets

Store your LearnWorlds API key and school subdomain in Lovable's encrypted Cloud → Secrets panel. In Lovable, click the '+' icon at the top of the editor to open the Cloud panel. Click the Secrets tab. Add: - Name: LEARNWORLDS_API_KEY — Value: your LearnWorlds API key - Name: LEARNWORLDS_SCHOOL_SUBDOMAIN — Value: your school subdomain (e.g., mycompany — just the subdomain, not the full URL) The Edge Function will construct the full API URL as: https://{LEARNWORLDS_SCHOOL_SUBDOMAIN}.learnworlds.com/api/v2/{endpoint}. LearnWorlds uses a custom header for API key authentication: Lw-Client (not the standard Authorization header). Your Edge Function will send Lw-Client: {apiKey} on every API request. This is different from most APIs that use Authorization: Bearer — make sure the Edge Function uses the correct header name. Some LearnWorlds API endpoints also require the Content-Type header to be set to application/json even for GET requests. Add this header to all API calls in the Edge Function to avoid unexpected 415 errors.

Pro tip: If you ever need to rotate your LearnWorlds API key (e.g., after a security review), generate a new key in LearnWorlds admin and update LEARNWORLDS_API_KEY in Cloud → Secrets. The Edge Function picks up the new value on its next cold start — no code deployment required.

Expected result: LEARNWORLDS_API_KEY and LEARNWORLDS_SCHOOL_SUBDOMAIN are stored in Cloud → Secrets with masked values.

3

Create the LearnWorlds API proxy Edge Function

Build the Edge Function that proxies requests from your Lovable frontend to the LearnWorlds API. LearnWorlds uses the Lw-Client header for API key authentication. Paste this prompt into Lovable's chat: 'Create a Supabase Edge Function at supabase/functions/learnworlds-api/index.ts. Read LEARNWORLDS_API_KEY and LEARNWORLDS_SCHOOL_SUBDOMAIN from Deno.env. Accept POST requests with body { endpoint: string, method: string, params?: object, body?: object }. Construct the URL as https://{subdomain}.learnworlds.com/api/v2/{endpoint}. Add the headers: Lw-Client: {apiKey}, Content-Type: application/json, Accept: application/json. Add params as query string for GET requests. Return the LearnWorlds API response as JSON with CORS headers.' LearnWorlds v2 API endpoints (verify current paths in dev.learnworlds.com): - GET /courses — list all courses - GET /courses/{courseId} — single course with sections and lectures - GET /users — list all users (paginated) - GET /users/{userId} — user profile - GET /users/{userId}/enrollments — user enrollments - GET /users/{userId}/certificates — user certificates - POST /enrollments — create an enrollment - GET /certificates/{certificateId} — certificate details LearnWorlds API responses use a data wrapper pattern for some endpoints: the actual data is in response.data while metadata (total count, pagination) is at the top level. Handle both flat responses and data-wrapped responses in your frontend components.

Lovable Prompt

Create a Supabase Edge Function at supabase/functions/learnworlds-api/index.ts. Read LEARNWORLDS_API_KEY and LEARNWORLDS_SCHOOL_SUBDOMAIN from Deno.env. Accept POST requests with { endpoint, method, params?, body? }. Call https://{subdomain}.learnworlds.com/api/v2/{endpoint} with Lw-Client: {apiKey} header and Content-Type: application/json. Return JSON response with CORS headers.

Paste this in Lovable chat

supabase/functions/learnworlds-api/index.ts
1// supabase/functions/learnworlds-api/index.ts
2const corsHeaders = {
3 'Access-Control-Allow-Origin': '*',
4 'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
5};
6
7Deno.serve(async (req) => {
8 if (req.method === 'OPTIONS') {
9 return new Response('ok', { headers: corsHeaders });
10 }
11
12 try {
13 const apiKey = Deno.env.get('LEARNWORLDS_API_KEY');
14 const subdomain = Deno.env.get('LEARNWORLDS_SCHOOL_SUBDOMAIN');
15
16 if (!apiKey || !subdomain) {
17 return new Response(
18 JSON.stringify({ error: 'LearnWorlds credentials not configured' }),
19 { status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
20 );
21 }
22
23 const { endpoint, method = 'GET', params, body: requestBody } = await req.json();
24
25 if (!endpoint) {
26 return new Response(
27 JSON.stringify({ error: 'endpoint is required' }),
28 { status: 400, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
29 );
30 }
31
32 let url = `https://${subdomain}.learnworlds.com/api/v2/${endpoint}`;
33
34 if (params && method === 'GET') {
35 const queryString = new URLSearchParams(
36 Object.entries(params).map(([k, v]) => [k, String(v)])
37 ).toString();
38 if (queryString) url += `?${queryString}`;
39 }
40
41 const response = await fetch(url, {
42 method,
43 headers: {
44 'Lw-Client': apiKey,
45 'Content-Type': 'application/json',
46 'Accept': 'application/json',
47 },
48 body: requestBody && method !== 'GET' ? JSON.stringify(requestBody) : undefined,
49 });
50
51 const data = await response.json();
52 return new Response(JSON.stringify(data), {
53 status: response.status,
54 headers: { ...corsHeaders, 'Content-Type': 'application/json' },
55 });
56 } catch (error) {
57 return new Response(
58 JSON.stringify({ error: error.message }),
59 { status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
60 );
61 }
62});

Pro tip: LearnWorlds API responses for list endpoints include a meta.pagination object with total_results and total_pages. Always check this for pagination — the default page size may not return all courses or users for large schools.

Expected result: The learnworlds-api Edge Function is deployed. When called with a valid endpoint, it successfully proxies requests to the LearnWorlds API using the Lw-Client auth header.

4

Build the branded course catalog and enrollment portal

Build the React components for your white-label learning portal. The key to a good white-label experience is ensuring all visible branding is your own — no LearnWorlds logos, colors, or terminology should appear in the UI. Paste this prompt into Lovable's chat: 'Create a LearnWorldsCoursePortal React component. Fetch all published courses from the learnworlds-api Edge Function (endpoint courses, params { status: published }). Display courses in a branded card grid using our company color scheme. Each card shows: course thumbnail (cover_image field), title, description (first 160 chars), duration (if available), price or Free if price is 0, and student count. Clicking a card shows a course detail page with: full description, curriculum (sections and lessons from courses/{id}), instructor bio, and an Enroll button. The Enroll button redirects to {schoolSubdomain}.learnworlds.com/course/{courseId} with SSO pre-authentication if configured.' LearnWorlds course objects include: id, title, description, excerpt, cover_image, duration, price, currency, status, labels (tags/categories), and created_at. The curriculum detail is in the sections array, each containing lessons (lectures, videos, quizzes). For the enrollment redirect, LearnWorlds supports Single Sign-On (SSO) via JWT — you can pre-authenticate users so they go directly to the course player without a separate LearnWorlds login. The SSO endpoint accepts a signed JWT token containing the user's information. This requires the SSO feature to be enabled in your LearnWorlds school settings and a shared JWT secret stored as a Lovable secret.

Lovable Prompt

Create a white-label LearnWorldsCoursePortal page. Fetch published courses from learnworlds-api Edge Function. Display courses in a branded grid with thumbnail, title, excerpt, and price. Course detail page shows full description, curriculum outline (sections and lessons), and an Enroll button linking to the LearnWorlds course URL. Style with our app's color scheme — no LearnWorlds branding should be visible.

Paste this in Lovable chat

Pro tip: LearnWorlds courses can have free, paid, or subscription-based access. Check the course's pricing_type field (free, one_time, subscription) to show the correct pricing label and enrollment CTA in your portal.

Expected result: A fully branded course catalog shows LearnWorlds courses with your company's visual identity. Clicking Enroll redirects users to the correct LearnWorlds checkout page for that course.

5

Build the certificate display and verification system

LearnWorlds generates professional certificates automatically when students complete courses. Build a certificate dashboard where students can view, download, and share their certificates, plus a public verification page. Paste this prompt into Lovable's chat: 'Create a Certificates section in the student dashboard. Call the learnworlds-api Edge Function with endpoint users/{userId}/certificates to fetch all certificates for the current user. Display each certificate as a card with: course name, completion date, a certificate thumbnail preview (preview_url field), a Download PDF button linking to certificate_url, and a Share on LinkedIn button that generates a LinkedIn certification URL. Also create a public verification page at /certificate/{certificateId} that any visitor can access without login. This page calls learnworlds-api with endpoint certificates/{id} and displays: student name, course name, school name, completion date, and a VERIFIED badge.' LearnWorlds certificate objects include: id, title (usually the course name), issued_at, certificate_url (PDF download URL), preview_url (thumbnail image), and user information. For the LinkedIn share button, LinkedIn's Add to Profile URL format is: https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME&name={encodedTitle}&organizationId={linkedinOrgId}&issueYear={year}&issueMonth={month}&certUrl={encodedCertUrl}&certId={certId}. Build this URL client-side from the certificate data and open it in a new tab. For the public verification page, use Lovable's route setup: create a page component that reads the certificateId from the URL params, fetches the certificate data without requiring user authentication (the Edge Function uses the API key, not user-level auth), and displays the verification result.

Lovable Prompt

Add a Certificates tab to the student dashboard. Fetch user certificates from learnworlds-api Edge Function (endpoint users/{userId}/certificates). Show certificate cards with course name, completion date, thumbnail, Download PDF button, and Share on LinkedIn button. Create a separate public route /certificate/:id that shows certificate verification information (student name, course, date, verified status) without requiring login.

Paste this in Lovable chat

Pro tip: For complex white-label deployments where you need SSO, custom certificate templates, or multi-school management — RapidDev's team can help configure LearnWorlds' advanced API features and design the enrollment flow architecture for your specific business model.

Expected result: Students can view all their earned certificates, download PDFs, and share on LinkedIn. The public verification page shows certificate details to anyone with the link without requiring login. The certificate UI matches your brand's visual identity.

Common use cases

White-label branded learning portal

Build a fully branded course portal where your company or client brand is the only thing students see — no LearnWorlds branding visible. Students browse, enroll, and access courses through your custom interface while LearnWorlds handles video delivery and course player behind the scenes.

Lovable Prompt

Create a branded learning portal. Call the learnworlds-api Edge Function to fetch all published courses. Display them in a branded card grid with our company colors and logo — no LearnWorlds branding anywhere. Show course title, thumbnail, description, price, and student count. Clicking a course card shows a detail page with the full description, curriculum preview (list of sections and lessons), and an Enroll button. The Enroll button redirects to the LearnWorlds checkout URL for that course.

Copy this prompt to try it in Lovable

Certificate generation and verification portal

Build a certificate management portal where students can download their earned certificates, share certificate links on LinkedIn, and where employers or partners can verify certificate authenticity via a public verification page.

Lovable Prompt

Create a certificate portal. Call the learnworlds-api Edge Function to fetch all certificates for the logged-in student from /api/v2/users/{userId}/certificates. Show certificates as cards with course name, completion date, certificate thumbnail, and buttons to Download PDF and Copy Verification Link. Create a public verification page at /verify/{certificateId} that calls the API to check certificate validity and shows the student name, course, and completion date without requiring login.

Copy this prompt to try it in Lovable

Corporate training enrollment and tracking dashboard

Build an HR or L&D dashboard where training coordinators can see all employees' enrollment status and progress across company training programs, enroll new hires into onboarding courses, and track certification compliance.

Lovable Prompt

Build an L&D coordinator dashboard. Fetch all users and their enrollments from the learnworlds-api Edge Function. Show a table with: employee name, email, enrolled courses count, completed courses count, and certificates earned count. Allow coordinators to select multiple employees and bulk-enroll them in a course using a POST to /api/v2/enrollments. Filter by department (stored in user tags in LearnWorlds). Export compliance report to CSV showing who has and has not completed required certifications.

Copy this prompt to try it in Lovable

Troubleshooting

API returns 401 Unauthorized with all requests

Cause: The Lw-Client header is missing from the request, or the LEARNWORLDS_API_KEY value does not match an active API key in your LearnWorlds school settings.

Solution: Verify LEARNWORLDS_API_KEY in Cloud → Secrets matches the API key shown in your LearnWorlds admin → Settings → Schools Settings → API exactly. Check Cloud → Logs to confirm the Edge Function is sending the Lw-Client header. Note that LearnWorlds uses Lw-Client as the header name — not Authorization: Bearer. If the header name is wrong, all requests will return 401 even with the correct key value.

Course catalog returns only some courses — not all published courses

Cause: LearnWorlds API responses are paginated. The default page size may not return all courses if your school has more than the per-page limit.

Solution: Add pagination parameters to your courses endpoint call: params { page: 1, per_page: 100 }. Check the meta.pagination.total_pages in the response and make additional calls for subsequent pages. For catalogs with more than 100 courses, implement a client-side load-more feature or aggregate all pages in the Edge Function before returning to the frontend.

Certificate download links return 403 or expired errors

Cause: LearnWorlds certificate download URLs may be time-limited or require user authentication to download. Direct linking to certificate_url may not work without proper session authentication.

Solution: Instead of linking directly to LearnWorlds' certificate_url, redirect users to the LearnWorlds student portal where they can download their certificate with their session active. Alternatively, configure your LearnWorlds school to use publicly accessible certificate URLs (check Settings → Certificates for sharing options). The preview_url (thumbnail image) is typically publicly accessible and can be shown without authentication.

Enrollment POST returns 422 Unprocessable Entity

Cause: The enrollment request body is missing required fields or contains invalid values — typically a missing course_id or user_id, or attempting to enroll a user who is already enrolled.

Solution: Check the LearnWorlds API documentation at dev.learnworlds.com for the exact required fields for POST /enrollments. Common required fields are user_id and course_id. Also check if the user already has an active enrollment — re-enrolling an already-enrolled user may return 422. Add a pre-check by fetching the user's enrollments before attempting to enroll, and show an 'already enrolled' message if applicable.

Best practices

  • Use the Lw-Client header (not Authorization: Bearer) for all LearnWorlds API calls — this is the most common integration mistake and causes all requests to fail with 401
  • Cache course catalog data in Supabase with a 30-minute refresh interval for public-facing pages — course metadata changes rarely and fetching live on every page load adds unnecessary latency
  • Remove all visual LearnWorlds branding from your portal — the whole point of white-labeling is that students only see your brand; ensure no error messages, loading states, or redirects reveal the underlying platform
  • Handle LearnWorlds pagination explicitly — assume any list endpoint has multiple pages and implement proper pagination or aggregation
  • Build certificate verification pages as public routes with no login requirement — the certificate ID itself is the access credential for public verification
  • Test enrollment flows end-to-end on a paid test course before deploying to production — LearnWorlds enrollment and payment handling has nuances for free vs. paid courses
  • Store your LearnWorlds school subdomain in Cloud → Secrets rather than hardcoding it, allowing URL changes without code deployments

Alternatives

Frequently asked questions

Does LearnWorlds have a native Lovable connector?

No. LearnWorlds is not one of Lovable's 17 shared connectors as of March 2026. You integrate it manually using LearnWorlds' API v2 with API key authentication (via the Lw-Client header), proxied through a Deno Edge Function. This tutorial covers the complete setup including course catalog display, enrollment, and certificate management.

What plan do I need to access the LearnWorlds API?

LearnWorlds API access is available on the Pro plan and above. The Starter plan does not include API access. If you need API access and are on the Starter plan, you need to upgrade. Contact LearnWorlds support to confirm API availability and any additional costs for API access on your current plan.

Can I use LearnWorlds SSO to authenticate users through my Lovable app?

Yes. LearnWorlds supports JWT-based Single Sign-On, allowing your Lovable app to authenticate users and pass them directly to the LearnWorlds course player without a separate LearnWorlds login. You create a signed JWT containing the user's identity information, and LearnWorlds creates or logs in the user automatically. The SSO feature requires a shared JWT secret and is enabled in LearnWorlds school settings. Store the JWT secret in Cloud → Secrets and generate the SSO token in your Edge Function.

How do I create a LearnWorlds enrollment from my Lovable app?

Use POST /api/v2/enrollments with a request body containing at least user_id (the LearnWorlds user ID) and course_id. For free courses, the enrollment is created immediately. For paid courses, the enrollment endpoint may create a pending enrollment that requires payment completion. You need to look up the LearnWorlds user ID by email first using GET /api/v2/users?email={email} if you are working with users who registered through your Lovable app rather than directly in LearnWorlds.

How do LearnWorlds certificates work compared to other course platforms?

LearnWorlds generates certificates automatically when a student completes a course (or meets the completion criteria you configure). Certificates are stored server-side and accessible via the API as PDF download URLs and preview thumbnails. Each certificate has a unique ID used for public verification. Compared to platforms like Teachable or Thinkific, LearnWorlds has more sophisticated certificate customization options including custom templates, dynamic field insertion, and bulk certificate generation.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.