This repository provides WebSharper bindings for Capacitor Community plugins, extending the functionality of WebSharper Capacitor.
WebSharper Capacitor Community enables developers to use additional Capacitor plugins maintained by the Capacitor Community within WebSharper projects. These bindings simplify the integration of community plugins, allowing for seamless development of cross-platform applications.
The following Capacitor Community plugins are currently bound in this repository:
- DeviceCheck - @capacitor-community/device-check
- SecurityProvider - @capacitor-community/security-provider
- ScreenBrightness - @capacitor-community/screen-brightness
- TextToSpeech - @capacitor-community/text-to-speech
- NativeAudio - @capacitor-community/native-audio
- BluetoothLe - @capacitor-community/bluetooth-le
- SafeArea - @capacitor-community/safe-area
- CameraPreview - @capacitor-community/camera-preview
- SpeechRecognition - @capacitor-community/speech-recognition
- Intercom - @capacitor-community/intercom
- PhotoViewer - @capacitor-community/photoviewer
- AppIcon - @capacitor-community/app-icon
- Media - @capacitor-community/media
- FacebookLogin - @capacitor-community/facebook-login
- Stripe - @capacitor-community/stripe
- PrivacyScreen - @capacitor-community/privacy-screen
- KeepAwake - @capacitor-community/keep-awake
- Contacts - @capacitor-community/contacts
- DatePicker - @capacitor-community/date-picker
- SQLite - @capacitor-community/sqlite
- ImageToText - @capacitor-community/image-to-text
- FileOpener - @capacitor-community/file-opener
- AppleSignIn - @capacitor-community/apple-sign-in
- BackgroundGeolocation - @capacitor-community/background-geolocation
- VolumeButtons - @capacitor-community/volume-buttons
- InAppReview - @capacitor-community/in-app-review
Before starting, ensure you have the following:
- Node.js and npm installed on your machine.
- Capacitor set up for managing cross-platform apps.
- WebSharper for building F#-based web applications.
- A project structure ready to integrate Capacitor and WebSharper.
-
Initialize a Capacitor project if not already done:
npm init # Initialize a new Node.js project npm install # Install default dependencies npm i @capacitor/core # Install Capacitor core library npm i -D @capacitor/cli # Install Capacitor CLI as a dev dependency npx cap init "YourApp" com.example.yourapp --web-dir wwwroot/dist # Initialize Capacitor in the project
-
Add the WebSharper Capacitor NuGet package:
dotnet add package WebSharper.Capacitor --version 8.0.0.494-beta1
This package is required because WebSharper Capacitor Community builds upon the core functionality provided by WebSharper Capacitor. It ensures compatibility and seamless integration of Capacitor plugins into your WebSharper project.
-
Add the WebSharper Capacitor Community NuGet package:
dotnet add package WebSharper.Capacitor.Community --version 8.0.0.494-beta1
-
Choose and install the Capacitor Community plugins you want to use. For example, to use the BluetoothLe plugin:
npm i @capacitor-community/bluetooth-le
-
Build your project:
npm i vite # Install Vite for building your web assets npx vite build # Build your web project with Vite
-
Sync configuration:
npx cap sync # Sync Capacitor configuration and plugins
- Ensure your Capacitor project is correctly configured with
capacitor.config.json
. - The WebSharper Capacitor Community package extends functionality provided by WebSharper Capacitor.
- Check out sample usage of plugins in the
WebSharper.Capacitor.Community.Sample
directory.