Skip to main content

Using Plugins

The WebView and the Napacitor runtime communicate through the use of Napacitor Plugins. Plugins provide access to native APIs such as battery status, geolocation, and device information in your web app. On the native side, each plugin is a C# class marked with [NapacitorPlugin] that runs inside the .NET MAUI host.

Napacitor Plugins​

The Napacitor team maintains a set of official plugins for commonly used APIs. Each one ships a maui/ C# project that nap sync wires into your host app automatically.

Learn more about Napacitor plugins ›

info

Do you want to make Napacitor plugins? Follow our plugin creation guides — the tutorial walks through a complete plugin from scratch.

Installing a plugin​

Install the npm package and sync so the host compiles the plugin's C# project:

npm install @napacitor/battery
npx nap sync

Always run nap sync after installing or removing plugins: it regenerates maui/napacitor.build.props with a project reference for each installed plugin. Without it, calls fail with an unimplemented error.