median-salesforce-components library into your Salesforce org and provides a full API reference for each component. It also includes the recommended patterns for building your own custom components that call the Median JavaScript Bridge.
This is part four of a four-part series:
- Getting started with Salesforce Experience Cloud
- Lightning Web Components and the Median JavaScript Bridge
- Deep linking for Salesforce Experience Cloud
- Component deployment and reference (this page)
Step 8: Deploy the open-source component library
The median-salesforce-components repository provides ready-to-deploy reference LWC components covering common Median integration patterns for Salesforce. All components have been tested on physical iOS and Android devices inside a Median-wrapped Experience Cloud app.gonativeio/median-salesforce-components
Loading repository data...
Deploy all components
Deploy a single component
Add components to an Experience Builder page
After deployment, open Experience Builder and drag the component from the component panel onto your page. All four components support the following targets:lightningCommunity__PagelightningCommunity__Defaultlightning__AppPagelightning__RecordPage

Experience Builder: custom components
Building a custom component
If you are building your own LWC that calls the JavaScript Bridge, follow these conventions for production-ready code. The patterns below are consistent with the open-source library and ensure correct behavior across Lightning Web Security, multiple Median SDK versions, and both in-app and out-of-app contexts.Component reference
oneSignal: Push notifications
Integrates the Median OneSignal plugin to manage push notification subscriptions. Provides the ability to retrieve device subscription info, associate a device with a Salesforce user via an external ID, and remove that association on sign-out.
Relevant for: customer communities where personalized push notifications are sent based on CRM data, such as case status updates, appointment reminders, or order confirmations.
Features:
- Get OneSignal device info via Promise or global callback
- Sign in a user by external ID (e.g. Salesforce Contact email or Account ID)
- Sign out the current user and remove the external ID association
- Graceful degradation with warning banner outside the Median app
Partial method coverageThis component only implements a subset of all JavaScript Bridge methods available. Please review our OneSignal documentation for a full JavaScript Bridge reference.
biometricAuth: Biometric authentication
Saves and retrieves credentials using the device’s native biometric hardware (Face ID on iOS, Fingerprint or Face Unlock on Android). Secrets are stored in the iOS Keychain or Android Keystore and are never written to Salesforce fields or browser storage.
Relevant for: field service, healthcare, and financial services applications where users authenticate repeatedly throughout the day and friction at sign-in measurably reduces adoption.
Features:
- Check whether the device supports biometrics and whether a secret is already stored
- Save a username and password as a JSON-encoded secret (no biometric prompt required to save)
- Retrieve a stored secret via a native biometric prompt, rendered in a read-only output field without navigating away from the page
- Delete the stored secret from the device keychain or keystore
minimumAndroidBiometric is set to 'strong' by default, which requires Class 3 (hardware-backed) biometrics on Android. Change this value in biometricAuth.js if your target device fleet uses Class 2 biometrics. Secrets are encoded as a JSON string in the format { "username": "...", "password": "..." }. Modify the saveSecret() method if you need to store a different data shape.
qrScannerNative: QR code and barcode scanning
Launches the device camera for QR code and barcode scanning. Returns the scanned value directly into the LWC component’s reactive state without navigating away from the page. Supports both Promise and global callback invocation patterns.
Relevant for: inventory management, asset tracking, event check-in, and field inspection workflows where users need to scan physical identifiers and match them to Salesforce records.
Features:
- Set a custom prompt message displayed inside the native scanner UI
- Scan via Promise (simpler code, recommended for most use cases)
- Scan via global callback (required for some Median SDK versions or where Promise is not available)
- Full raw JSON output in a resizable read-only textarea
- Structured result card showing scanned code and barcode type
- Loading spinner shown while the native scanner UI is open
- Graceful handling of user cancellation
{ "success": false, "error": "cancelled" }. This is handled gracefully with a status badge rather than an error state.
pdfViewer: Native PDF handling
Opens and downloads PDF files using the device’s native PDF viewer. Configure a default PDF URL via a constant at the top of
pdfViewer.js, and optionally override it at runtime via the URL input field.
Relevant for: portals that serve policy documents, contracts, inspection reports, field manuals, or any other PDF that users need to view, annotate, or share from their device.
Features:
- Hardcoded default PDF URL (set
DEFAULT_PDF_URLinpdfViewer.js) - Editable URL input field for runtime testing without redeployment
- Read-only URL display textbox showing the active URL before triggering an action
- Open PDF using
window.location.href, which the Median native layer intercepts and renders in PDFKit (iOS) or PDFViewer (Android) without leaving the page - Download PDF to the device via
median.share.downloadFile()(Android: Downloads folder; iOS: native Share / Save to Files sheet)
pdfViewer.js and update the constant at the top of the file: