Tauri v2 uses a capability and permission system to control which IPC commands your frontend JavaScript can call into the Rust backend. Every plugin command is blocked by default — you must explicitly grant access in a capabilities file before your app can list printers, send print jobs, or run test prints. This model follows the principle of least privilege: your app only exposes the exact surface area it needs, reducing the attack vector for malicious web content running inside the WebView.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/luis3132/tauri-plugin-thermal-printer/llms.txt
Use this file to discover all available pages before exploring further.
Adding Permissions to Your Capabilities File
Capabilities are declared in JSON files insidesrc-tauri/capabilities/. The default file is src-tauri/capabilities/default.json. Add the thermal-printer permission identifiers you need to the permissions array:
Default Permission Set
The plugin ships a pre-composed default set that grants access to every command exposed by the plugin. It is defined inpermissions/default.toml:
"thermal-printer:default" to enable everything at once.
Permission Reference
The table below lists every permission identifier provided by the plugin. Each command has a matchingallow-* entry (grants access) and a deny-* entry (blocks access).
| Identifier | Description |
|---|---|
thermal-printer:allow-list-thermal-printers | Enables the list_thermal_printers command — returns all printers visible to the host OS. |
thermal-printer:deny-list-thermal-printers | Denies the list_thermal_printers command. |
thermal-printer:allow-print-thermal-printer | Enables the print_thermal_printer command — sends a PrintJobRequest to a printer. |
thermal-printer:deny-print-thermal-printer | Denies the print_thermal_printer command. |
thermal-printer:allow-test-thermal-printer | Enables the test_thermal_printer command — sends a diagnostic test print. |
thermal-printer:deny-test-thermal-printer | Denies the test_thermal_printer command. |
thermal-printer:allow-ping | Enables the internal ping command used by the plugin’s health check. |
thermal-printer:deny-ping | Denies the ping command. |
Android Bluetooth Permissions
On Android the plugin communicates with thermal printers over Bluetooth SPP
(Serial Port Profile). The following Android permissions are declared directly
in the Kotlin plugin manifest and are requested automatically at runtime
— you do not need to add anything to your Tauri capability files for them:
BLUETOOTHBLUETOOTH_ADMINBLUETOOTH_SCANBLUETOOTH_CONNECTACCESS_FINE_LOCATION
"AA:BB:CC:DD:EE:FF") as the printer
field in your PrintJobRequest.