mrkeyoor.comAsk

npm package

@aptabase/tauri review

Choose @aptabase/tauri when you can own the Rust setup and want explicit Aptabase events in a Tauri app.

npmUtilsupdated 04 Dec 2026

Installing @aptabase/tauri is only part of adding Aptabase analytics to a Tauri app. The JavaScript bindings call a native Rust plugin, which needs registration and access permissions. This guide covers @aptabase/tauri 0.7.0 and explains the setup, explicit event calls and optional beta error reporting. Its central limit is delivery: awaiting a native command does not confirm that the analytics server received the event.

Verdict

Choose @aptabase/tauri when you can own the Rust setup and want explicit Aptabase events in a Tauri app. Skip it for durable event records or complete crash capture. Verify one event in your own built app before expanding instrumentation.

Answers from our run

@aptabase/tauri or @aptabase/web: which should you use?

@aptabase/web: Evaluate @aptabase/web for a web application. Its registry describes a JavaScript SDK for Aptabase covering web apps. This supports a platform alternative, not a claim that it can replace the native Tauri integration unchanged. Choose @aptabase/tauri when you can own the Rust setup and want explicit Aptabase events in a Tauri app.

When should you not use @aptabase/tauri?

You need analytics in an ordinary browser page. These bindings invoke a Tauri native command and need the native plugin.

API stability3/5Documentation-based rubric: 1 means an unclear interface, 3 means a traceable versioned interface with stated limits, and 5 requires compatibility evidence across upgrades and targets. Score 3 reflects registry identity, pinned TypeScript signatures and the beta label on error reporting. Published declarations, upgrade behavior and platform compatibility were not independently checked.
Docs3/5Documentation-based rubric: 1 means no usable starting point, 3 means setup and important failure boundaries are explained, and 5 requires a verified operational path for the intended deployment. Score 3 reflects the README's Rust setup, registration, permissions and memory-only delivery explanation. Its examples use different setup styles, and no quickstart execution is documented here.
Maintenance3/5Release-evidence rubric: 1 means no inspectable release trail, 3 means an inspectable release with concrete changes, and 5 requires broader evidence of sustained support. Score 3 reflects the inspected 1.3.0 release and its specific recorded repair: the flush now runs on the runtime. The notes describe an exit-time flush panic outside Tauri's async runtime. This is release documentation, not a reproduced fix or a measurement of support responsiveness; the supplied extract does not establish the release year.
Ecosystem2/5Integration-evidence rubric: 1 means package identity only, 2 adds documented integration paths, 3 requires independently verified working integrations, and 5 requires broader adoption evidence. Score 2 reflects the declared Tauri API dependency and documented frontend/Rust setup. No downstream runtime check, production deployment or adoption measurement is supplied, so unknown compatibility and usage do not earn a higher score.

Use it if

You maintain a Tauri application and want to send named events, such as opening settings or completing an export, to Aptabase.
You can change both the frontend and the Rust application, including plugin registration and access permissions.
You want to choose which product actions generate events through explicit trackEvent calls.
You already use Aptabase and want to evaluate its beta error reporting alongside event instrumentation.

Skip it if

You need analytics in an ordinary browser page. These bindings invoke a Tauri native command and need the native plugin.
You need a durable offline event journal. The documented queue lives in memory and isn't saved to disk.
You need confirmation that each awaited event reached the analytics server. trackEvent awaits the native invocation; delivery happens in the background.
You need automatic capture of every user action. The documented event workflow requires manual instrumentation.
You need complete native crash coverage. The README excludes crashes that bypass Rust's panic handler, including a segfault or native abort.

Setup reality

No installation, Tauri compilation or event delivery to an Aptabase account is documented in the supplied evidence. All snippets below are documentation-based, unexecuted illustrations. The supplied TypeScript implementation is pinned to the gitHead identified by the npm registry. It supports the illustrated function signatures and native invocation behavior; the published package declarations were not independently checked. These sources do not establish operation on your target desktop or mobile platform.

The 1.3.0 release pairs Rust plugin 1.3.0 with JavaScript bindings 0.7.0. Keep those version numbers distinct. The npm registry declares @tauri-apps/api ^2.10.1 as a dependency, so use this guide for a Tauri 2 integration. The release notes specify Rust 1.85.0. You also need the platform tooling required to build your Tauri app. The supplied sources do not establish that existing lockfiles or native builds will work unchanged.

Install the JavaScript package, add the Rust dependency, then register the plugin on your existing Tauri builder before running it. Get an App Key from the Instructions menu in Aptabase and replace the placeholder in the example. Add aptabase:allow-track-event to the access permissions for the calling window. Error reporting needs the separate aptabase:allow-track-error permission. Installing npm dependencies alone does not perform these native and permission steps.

Start with one named event that contains no user text. Custom event property values are strings or numbers. Convert booleans deliberately and choose a small vocabulary for screen names or export formats. Avoid sending document contents or full local paths merely because a property accepts a string. Review error reports separately: their messages and stack traces can contain details you did not intend to collect.

The README documents event delivery every 60 seconds in release builds and every 2 seconds in debug builds. Events are queued in memory and sent in the background: every 60 seconds in release builds and every 2 seconds in debug builds. Network failures and server 5xx responses leave events queued for a later flush; other unsuccessful statuses drop them. The queue isn't saved to disk. An awaited trackEvent call is therefore not a server receipt. The snippets catch native invocation failures, but their catch blocks cannot detect every later delivery failure. Use another storage mechanism if your workflow needs a durable audit record.

Error reporting is beta. Calling trackError reports a handled error without enabling automatic crash reporting. Automatic reporting requires a separate Builder option and still excludes native crashes outside Rust's panic handler. Error reports also have different delivery rules: the release notes say they are sent immediately, with network errors, 408, 429 and 5xx retried; a 403 for an exhausted monthly error quota and other 4xx responses are dropped. The fatal option marks severity and is forwarded to the native command; the helper does not terminate the application.

Before adoption, build your app on its actual target, trigger one non-sensitive event and one deliberately safe handled error, and inspect both in the Aptabase dashboard. Then check behavior when the app closes or loses its network connection. These are recommended next steps, not completed runtime checks.

Patterns

Pin the JavaScript bindings install-bindings

npm install @aptabase/tauri@0.7.0

Run this in your existing Tauri frontend project. It installs the guest bindings, not the Rust plugin. All examples are unexecuted illustrations for this package version.

Add the paired Rust plugin add-native-plugin

[dependencies]
tauri-plugin-aptabase = "=1.3.0"

Merge the entry into src-tauri/Cargo.toml without creating a second dependencies table. The exact pin keeps the example on the release that names JavaScript bindings 0.7.0. Its release notes specify Rust 1.85.0.

Register Aptabase on the existing builder register-native-plugin

tauri::Builder::default()
    .plugin(tauri_plugin_aptabase::Builder::new("<YOUR_APP_KEY>").build())
    .run(tauri::generate_context!())
    .expect("error while running tauri application");

This is a builder-chain fragment for your existing Rust entry point, not a complete main.rs. Keep other plugins and setup hooks. Replace the placeholder with the App Key from Aptabase before running the app.

Grant event and handled-error permissions allow-frontend-commands

"permissions": [
  "core:default",
  "aptabase:allow-track-event",
  "aptabase:allow-track-error"
]

Merge these Aptabase permissions into the existing capability for the calling window. This is a JSON property fragment, not a complete capability file. Keep existing permissions. Omit aptabase:allow-track-error if you do not use error reporting. The pinned README names both Aptabase identifiers.

Send one explicit event send-named-event

import { trackEvent } from '@aptabase/tauri';

async function recordSettingsOpened() {
  try {
    await trackEvent('settings_opened');
  } catch {
    console.warn('Analytics command failed');
  }
}

Call this function when settings actually open inside the Tauri frontend. The supplied implementation awaits the native invocation. Catching its rejection does not establish whether later background HTTP delivery succeeds.

Keep custom properties flat send-event-properties

import { trackEvent } from '@aptabase/tauri';

async function recordExport(format, itemCount) {
  try {
    await trackEvent('export_completed', {
      format,
      item_count: itemCount,
    });
  } catch {
    console.warn('Analytics command failed');
  }
}

Call recordExport('png', 4) only after the application's export succeeds. Pass a string format and numeric count: the Props type in the supplied TypeScript source allows string or number values. Objects, arrays and booleans do not fit that contract. This helper does not perform an export or validate its arguments.

Check an application-owned collection preference respect-local-preference

import { trackEvent } from '@aptabase/tauri';

async function recordThemeChange(analyticsEnabled, theme) {
  if (!analyticsEnabled) return;
  try {
    await trackEvent('theme_changed', { theme });
  } catch {
    console.warn('Analytics command failed');
  }
}

analyticsEnabled must come from your app's preference handling. Pass a bounded string such as 'dark' for theme. This guard is application code, not an SDK consent API. It suppresses this call only; it does not clear queued events or disable other instrumentation.

Report an error the application caught report-handled-error

import { trackError } from '@aptabase/tauri';

async function reportHandledError(error) {
  try {
    await trackError(error);
  } catch {
    console.warn('Error-report command failed');
  }
}

Call this from an existing catch block after deciding the error is safe to send. It needs aptabase:allow-track-error. The supplied implementation accepts unknown values, extracts Error name/message/stack, and stringifies other thrown values. This helper does not enable automatic crash reporting.

Label a report as fatal label-fatal-report

import { trackError } from '@aptabase/tauri';

async function reportFatalError(error) {
  try {
    await trackError(error, { fatal: true });
  } catch {
    console.warn('Fatal-report command failed');
  }
}

Use this for an error your application's workflow cannot recover from. The supplied implementation forwards fatal as options?.fatal === true. This helper does not terminate the app, enable crash hooks or confirm server receipt. Error reporting remains beta.

Alternatives

PackageRegistryPick it when
@aptabase/webnpmEvaluate @aptabase/web for a web application. Its registry describes a JavaScript SDK for Aptabase covering web apps. This supports a platform alternative, not a claim that it can replace the native Tauri integration unchanged.
posthog-jsnpmConsider posthog-js for automatic usage capture sent to PostHog. Its registry describes that purpose. This changes the analytics destination and capture approach; the supplied evidence does not establish Tauri compatibility or a drop-in replacement.

More utils guides

How this guide is made: grounded in the library's documentation, release notes, changelog, and issue history, on a fixed rubric — not a hands-on install of every release. The 50 most-downloaded entries are additionally install-verified in clean containers. Corrections: contact the desk.