@choochmeque/tauri-plugin-sharekit-api

中文文档
0.4.0-rc.8发布于 2026/11/07MITTypeScriptESM + CJS构建来源已验证近 30 天下载 2.3万

A Tauri v2 plugin that enables sharing content with native sharing interfaces on Android, iOS, macOS and Windows.

原始使用文档
文档目录4 节
  1. Install
  2. Usage
  3. Contributing
  4. License

NPM Version Crates.io Version License: MIT

Tauri Plugin ShareKit

Share content to other apps via native sharing interfaces on Android, iOS, macOS and Windows.

Install

This plugin requires a Rust version of at least 1.65

There are three general methods of installation that we can recommend.

  1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
  2. Pull sources directly from Github using git tags / revision hashes (most secure)
  3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)

Install the Core plugin by adding the following to your Cargo.toml file:

src-tauri/Cargo.toml

[dependencies]
tauri-plugin-sharekit = "0.4"
# alternatively with Git:
tauri-plugin-sharekit = { git = "https://github.com/Choochmeque/tauri-plugin-sharekit" }

You can install the JavaScript Guest bindings using your preferred JavaScript package manager:

pnpm add @choochmeque/tauri-plugin-sharekit-api
# or
npm add @choochmeque/tauri-plugin-sharekit-api
# or
yarn add @choochmeque/tauri-plugin-sharekit-api

# alternatively with Git:
pnpm add https://github.com/Choochmeque/tauri-plugin-sharekit
# or
npm add https://github.com/Choochmeque/tauri-plugin-sharekit
# or
yarn add https://github.com/Choochmeque/tauri-plugin-sharekit

Usage

First you need to register the core plugin with Tauri:

src-tauri/src/main.rs

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_sharekit::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Afterwards all the plugin's APIs are available through the JavaScript guest bindings:

import { shareText, shareFile } from "@choochmeque/tauri-plugin-sharekit-api";

// Share text
await shareText('Tauri is great!');

// Share a file
await shareFile('file:///path/to/document.pdf', {
  mimeType: 'application/pdf',
  title: 'My Document'
});

// Share with position (iPad/macOS only)
// x and y are in webview coordinates (pixels from top-left)
await shareText('Hello!', {
  position: { x: 100, y: 200, preferredEdge: 'bottom' }
});

Contributing

PRs accepted. Please make sure to read the Contributing Guide before making a pull request.

License

MIT

版本与发布记录

@choochmeque/tauri-plugin-sharekit-api 共发布 19 个版本,首次发布于 2025/08/28;过去 12 个月发布了 11 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.0-rc.8latest2026/11/072 天前
0.4.0-rc.72026/09/012 个月前
0.4.0-rc.52026/06/174 个月前
0.4.0-rc.42026/06/154 个月前
0.4.0-rc.32026/06/144 个月前
0.4.0-rc.22026/06/144 个月前

关于 @choochmeque/tauri-plugin-sharekit-api 的常见问题

@choochmeque/tauri-plugin-sharekit-api 是什么?

A Tauri v2 plugin that enables sharing content with native sharing interfaces on Android, iOS, macOS and Windows.

如何安装 @choochmeque/tauri-plugin-sharekit-api?

在项目目录运行 npm install @choochmeque/tauri-plugin-sharekit-api,或使用 pnpm add / yarn add / bun add。

@choochmeque/tauri-plugin-sharekit-api 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@choochmeque/tauri-plugin-sharekit-api 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@choochmeque/tauri-plugin-sharekit-api 可以商用吗?

@choochmeque/tauri-plugin-sharekit-api 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@choochmeque/tauri-plugin-sharekit-api 的下载量有多少?

根据 npm 官方下载统计,@choochmeque/tauri-plugin-sharekit-api 在 2026/10/10 – 2026/11/08 这 30 天内被下载 22,757 次,日均约 759 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@choochmeque/tauri-plugin-sharekit-api 还在维护吗?

最新版本 0.4.0-rc.8 发布于 2026/11/07(2 天前);至今共发布 19 个版本,其中过去 12 个月发布了 11 个;首次发布于 2025/08/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。