Vue composables for Tauri API in Nuxt applications.
- 🚀 Auto-imported composables for Tauri API
- 💪 Full TypeScript support with generic typing
- ⚡ Reactive state management with Vue refs
- 🔄 Built-in error handling and loading states
- 🎯 Zero configuration setup
Install the module to your Nuxt application:
npx nuxi module add nuxt-module-tauriAdd the peer dependency:
pnpm add @tauri-apps/apiThat's it! You can now use Tauri composables in your Nuxt app ✨
For complete guides, API reference, and advanced examples, visit our documentation:
🌐 English Documentation
🇫🇷 Documentation Française
The documentation includes:
- 📚 Complete API reference
- 🎯 Step-by-step guides
- 💡 Advanced usage patterns
- 🔧 Configuration options
⚠️ Error handling examples
Execute Tauri commands with reactive state management:
<script setup>
// Basic usage
const { data, pending, error, execute } = useTauriInvoke("get_user", {
id: 123,
});
// With TypeScript
const { data, pending, error, execute } =
useTauriInvoke < User > ("get_user", { id: 123 });
// Immediate execution
const { data, pending, error } = useTauriInvoke(
"get_config",
{},
{ immediate: true }
);
</script>Listen to and emit Tauri events:
<script setup>
// Basic usage
const { data, error, startListening, stopListening, emit } =
useTauriEvent("my-event");
// With TypeScript
const { data, error, startListening, stopListening, emit } =
useTauriEvent < EventPayload > "my-event";
</script>📖 See complete examples and API reference →
Execute a Tauri command with reactive state.
Returns: { data, pending, error, execute, refresh }
Listen to and emit Tauri events.
Returns: { data, error, startListening, stopListening, emit }
📖 Complete API documentation with examples →
- Nuxt 3.x
- @tauri-apps/api ^2.7.0
- Tauri application context (composables will show errors in browser)
# Install dependencies
pnpm install
# Generate type stubs
pnpm run dev:prepare
# Develop with the playground
pnpm run dev
# Build the playground
pnpm run dev:build
# Run ESLint
pnpm run lint
# Run Vitest
pnpm run test
pnpm run test:watch
# Release new version
pnpm run release