Skip to main content
Home

A keyring crate wrapper for tauri apps.

This package works with BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
64%
Published
11 months ago (0.1.1)

Tauri Plugin keyring

NPM Version Crates.io Version

A simple wrapper over rust keyring crate. This may be useful for many applications that require storing user's sensitive data on disk, so although it's simple, I made a plugin for it.

Using keyring allows you to store user's password in the system keychain safely without prompting user for password everytime.

Tauri's stronghold plugin is also used for storing secrets and keys. But it requires user to enter a password or storing the encryption key somewhere. keyring is a good place to store this encryption key.

Sample Usage:

  • Storing random database encryption key
  • Storing user's password for auto-login
  • Storing user's auth token

Sample Project that uses this plugin: kunkunsh/kunkun

Installation

Usage

TypeScript/JavaScript

import {
  getPassword,
  setPassword,
  deletePassword,
} from "tauri-plugin-keyring-api";

const service = "my-service";
const user = "my-user";

if (!pass) {
  await setPassword(service, user, "my-password");
}
const pass: string = await getPassword(service, user);

await deletePassword(service, user);

Rust

use tauri::Manager;
use tauri_plugin_keyring::KeyringExt;
// app is a tauri::AppHandle
let pass: Option<String> = app.keyring().get_password("tauri-plugin-keyring", "test")?;

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@hk/tauri-plugin-keyring-api

Import symbol

import * as tauri_plugin_keyring_api from "@hk/tauri-plugin-keyring-api";
or

Import directly with a jsr specifier

import * as tauri_plugin_keyring_api from "jsr:@hk/tauri-plugin-keyring-api";

Add Package

pnpm i jsr:@hk/tauri-plugin-keyring-api
or (using pnpm 10.8 or older)
pnpm dlx jsr add @hk/tauri-plugin-keyring-api

Import symbol

import * as tauri_plugin_keyring_api from "@hk/tauri-plugin-keyring-api";

Add Package

yarn add jsr:@hk/tauri-plugin-keyring-api
or (using Yarn 4.8 or older)
yarn dlx jsr add @hk/tauri-plugin-keyring-api

Import symbol

import * as tauri_plugin_keyring_api from "@hk/tauri-plugin-keyring-api";

Add Package

vlt install jsr:@hk/tauri-plugin-keyring-api

Import symbol

import * as tauri_plugin_keyring_api from "@hk/tauri-plugin-keyring-api";

Add Package

npx jsr add @hk/tauri-plugin-keyring-api

Import symbol

import * as tauri_plugin_keyring_api from "@hk/tauri-plugin-keyring-api";

Add Package

bunx jsr add @hk/tauri-plugin-keyring-api

Import symbol

import * as tauri_plugin_keyring_api from "@hk/tauri-plugin-keyring-api";