Lovable creditsBuilding apps in Lovable costs credits. The prompt in this guide uses between 10–15 credits.On Lovable’s Free plan you get 5 daily build credits, which reset every day at 00:00 UTC, capped at 30 build credits per calendar month. See Lovable credits and usage for more information on usage.
Build the app in Lovable
Prompt Lovable
- Go to lovable.dev .
- Create an account or sign in.
- In Plan mode, enter a prompt or paste this one:
Build a mobile-first health app named Daily Health.
- Review the agent’s plan, suggest any changes if needed, then approve it.
- Your Lovable agent will build the app and display a preview in the browser.
Review the Lovable app
- Create an account (check your inbox and spam for the confirmation email).
- Review the Dashboard and Profile pages. Prompt your Lovable agent to adjust design or copy if needed.
- Confirm that in a normal browser the health cards show ”—” and the app-only message (no fake data).
- Publish your Lovable app and copy the public URL.
Create your app in Median App Studio
- Enter your Lovable URL below and click Build Now.
- Follow the prompts to create the app.
- Follow our Quickstart guide to set up and customize your app.
Configure the Median JavaScript Bridge and enable app plugins
The Median JavaScript Bridge is an API that connects your website (Lovable app) to your mobile app. In this guide, the Lovable app uses it to receive push notifications, retrieve health data from the device, and trigger haptic feedback.Update the JavaScript frameworks and NPM setting
- In App Studio, head over to Web Overrides.
- Under JavaScript Frameworks and NPM, select Use NPM Package.
- Save your changes.

App Studio – JavaScript Frameworks and NPM
Enable app plugins
Go to the Native Plugins page, then add and enable these plugins:- Health Bridge
- OneSignal
- Haptic Feedback
Set up OneSignal push notifications
This guide uses OneSignal to send push notifications to the app. To set this up you’ll need:- A OneSignal account (free to create)
- Your OneSignal App ID (OneSignal dashboard → Settings → Keys & IDs)
- An Apple Developer account (iOS / APNS) and/or a Google Firebase project (Android / FCM)
- Go to Native Plugins → OneSignal and enter your OneSignal App ID.
- Review the configuration settings and update as needed. Click the documentation chips for more information on the settings.
- Save and rebuild the app.
Build and test on a device
Follow the relevant documentation below to install the mobile app on a physical device and test the native features. For iOS, you can upload your app directly to your Apple Developer account and register a test device in App Studio. iOS Android How to test?- Sign up or sign in inside the Median app
- Tap Connect Health / Refresh prompts for health permissions and accept
- Confirm the user’s step count is saved to the database (Supabase)
- Confirm you receive haptic feedback when the health data updates after tapping the Refresh button
- Confirm you can subscribe to push notifications by accepting the device prompts
- In a normal browser, health data metrics show up as ”—” and there are attempts to execute commands on the Median JavaScript Bridge
Development checklist
App creation- You’ve created the web app in Lovable
- You’ve created a Median app using your Lovable public URL
- In App Studio, Web Overrides → JavaScript Frameworks and NPM is set to Use NPM Package
-
The Lovable app imports
median-js-bridge - Health Bridge, Haptic Feedback, and OneSignal plugins are enabled
- OneSignal App ID is added in App Studio → Native Plugins → OneSignal
- The Median app has been rebuilt after enabling the plugins and uses the latest build version
- You can install the mobile app on a physical device
- You can sign in to the Lovable app inside the mobile app
- Health cards load real device data after Connect Health / Refresh.
- The app provides haptic feedback on successful health refresh
- The app can receive push notifications (after OneSignal credentials are configured)
- Profile push opt-in / opt-out works as expected
Troubleshooting
Health cards still show ”—” inside the Median app
Confirm you are testing on a physical device, not the App Studio virtual simulator. Verify Health Bridge is enabled, then go to Build & Deploy and click Build all. In the app, tap Connect Health / Refresh, grant permissions when prompted, and confirmMedian.isNativeApp() is true. For more information, see Health Bridge.
Health permission prompt never appears
Make sure the Connect Health flow only runs whenMedian.isNativeApp() is true and calls Median.healthBridge.requestPermissions(["steps", "heartRate", "activeEnergy"]) before getData. On iOS, the system may not report grant status from requestPermissions; the OS can prompt when data is first requested. If the user previously denied access, they must enable Health permissions in iOS Settings → Health / Android Health Connect settings.
Median JavaScript Bridge functions are undefined or not working
Confirm the Lovable project installedmedian-js-bridge, and in App Studio go to Web Overrides → JavaScript Frameworks and NPM and set it to Use NPM package, then rebuild. Calling Health Bridge, OneSignal, or Haptics in a normal browser will fail; those APIs only work inside the Median app. For more information on the library, see npm package.
Haptic feedback does not trigger
Verify the Haptic Feedback plugin is enabled in App Studio and your app build is up to date. Haptics trigger after the health data renders, usingMedian.haptics.trigger({ style: "notificationSuccess" }), and only when Median.isNativeApp() is true. Tap the refresh button to trigger another render. Haptics cannot be tested reliably in a desktop browser. See Haptics.
Push notifications are not arriving
Confirm the OneSignal App ID is set under Native Plugins → OneSignal, APNS (iOS) and/or FCM (Android) credentials are configured in OneSignal, and the app has been rebuilt after. Test on a physical device. Check that the user opted in (first sign-in prompt and Profile toggle) per User consent management. For more information, see OneSignal.Lovable public URL does not load outside the editor
Publish the Lovable app again and copy the public URL from the publish settings (top right of the Lovable dashboard). Go to the URL in a private/incognito window. If it still fails, check Lovable’s publish status and any build/deploy errors before building the app in App Studio.App Studio preview looks fine but native features fail
The app won’t display health data in the App Studio simulator, only on a physical device or in an Xcode simulator using mock data. To install a device build, see Install Android APK or Build iOS binary, then retest Connect Health, haptics, and push on hardware.What’s the difference between median. and Median.?
These are the two ways to reach the Median JavaScript Bridge from your website.median. commands use the library injected into the app. Median. commands use the median-js-bridge npm package. This guide uses the npm package.