https://github.com/vasak-os/tauri-plugin-user-data
A plugin for user data management in Tauri applications.
https://github.com/vasak-os/tauri-plugin-user-data
linux tauri tauri-plugin vasak vasakos
Last synced: about 1 month ago
JSON representation
A plugin for user data management in Tauri applications.
- Host: GitHub
- URL: https://github.com/vasak-os/tauri-plugin-user-data
- Owner: Vasak-OS
- Created: 2025-04-29T19:33:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-29T20:06:12.000Z (about 1 year ago)
- Last Synced: 2025-04-29T21:22:36.414Z (about 1 year ago)
- Topics: linux, tauri, tauri-plugin, vasak, vasakos
- Language: Rust
- Homepage:
- Size: 402 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tauri Plugin user-data
A simple plugin that allows you to get the operating system icons by name (only works on Linux) by getting it in base64 ready to use the src of any image
## Installation
```bash
bun add @vasakgroup/plugin-user-data
```
Add in `cargo.toml`
```toml
[dependencies]
tauri-plugin-user-data = { git = "https://github.com/Vasak-OS/tauri-plugin-user-data", branch = "v2" }
```
In `main.rs` or `lib.rs`, add the following to your `tauri::Builder`:
```rust
use tauri_plugin_user_data;
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_user_data::init()) // this line
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```
And add in `src-tauri/compatibilites/default.json`
```json
{
"permissions": [
...
"user-data:default",
]
}
```
## Usage
```ts
import { getUserData } from '@vasakgroup/plugin-user-data';
const icon = await getUserData('folder');
```
in vue
```vue
import { getUserData } from '@vasakgroup/plugin-user-data';
import { ref } from 'vue';
const user = ref('');
const getUserInfo = async () => {
user.value = await getUserData();
};
getUserInfo();
{{ user }}
```