npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

tauri-plugin-web-auth-api

v1.0.0

Published

Leverage iOS' ASWebAuthenticationSession and Android's Custom Tabs to authenticate users in your Tauri app.

Readme

Tauri Plugin web_auth

[!CAUTION] This was a plugin primarily made for myself. I've made it open-source so that other people could use it, but I'm not willing to document everything. If you do need some help / clarification / changes, you can contact me on Discord / Twitter: manaf941 / manaaaaaaaf

[!WARNING] I have NOT tested this plugin in conjunction with the Tauri Deep Linking plugin. It MAY be incompatible. I cannot guarantee this will work with your setup.

[!NOTE] This plugin only works on iOS and Android. I have no plan to bring it to Desktop. I will answer pull requests though

Demo

[future me insert video here]

Usage

src-tauri/src/lib.rs

Add crate tauri-plugin-web-auth first

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        // this line initializes the plugin
        .plugin(tauri_plugin_web_auth::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

src-tauri/capabilities/default.json

{
    "permissions": [
        "web-auth:default",
        "web-auth:allow-authenticate"
    ]
}

index.ts

import { authenticate } from 'tauri-plugin-web-auth-api'

// Example: Authenticate to google
// scheme is `iOS URL scheme` in Google Cloud Console
const scheme = "com.googleusercontent.apps.807645982538-7ib8rr1tkjkeb3vr0u1lk7gs6ip3b0jl"
const url = new URL("https://accounts.google.com/o/oauth2/v2/auth")
url.searchParams.set("response_type", "code")
// client id is `Client ID` under Google Cloud Console, it's basically the reverse scheme
url.searchParams.set("client_id", "807645982538-7ib8rr1tkjkeb3vr0u1lk7gs6ip3b0jl.apps.googleusercontent.com")
url.searchParams.set("redirect_uri", scheme+":/")
// scope must be separated by spaces
url.searchParams.set("scope", "email")
s
const res = await authenticate({
    url: url.toString(),
    callbackScheme: scheme,
})

const callback_url = new URL(res.callbackUrl)
// You can then exchange this code with your backend or with google to
// get the user's informations
console.log(`Got code: ${callback_url.searchParams.get("code")}`)   

Setup

iOS

iOS should work out of the box, no need to modify any configuration files.

Android

Android is bit more annoying. You need to add the callback scheme to your src-tauri/gen/android/app/src/AndroidManifest.xml file.

<!-- Find the android:name=".MainActivitiy" Activity and add the second intent filter-->
<activity
    android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
    android:launchMode="singleTask"
    android:label="@string/main_activity_title"
    android:name=".MainActivity"
    android:exported="true">
    <intent-filter>
        ...
    </intent-filter>

    <!-- Add this intent filter to allow Google Authentication -->
    <!-- You need to add one intent filter per scheme -->
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="com.googleusercontent.apps.807645982538-7ib8rr1tkjkeb3vr0u1lk7gs6ip3b0jl" />
    </intent-filter>
</activity>

Contact

In case of questions, contact me on my socials: Discord: @manaf941 Twitter: manaaaaaaaf