An open API service indexing awesome lists of open source software.

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.

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 }}

```