tauri-plugin-social-auth
Native social auth plugin for Tauri applications with a single unified command surface.
Platform matrix
| Provider | iOS | macOS | Android | Web |
|---|---|---|---|---|
| Apple | Native | Native | Unsupported | Unsupported |
| Native | Unsupported | Native | Unsupported | |
| VK ID | Native | Unsupported | Native | Unsupported |
| Yandex | Native | Unsupported | Native | Unsupported |
Notes:
Unsupportedmeans the plugin command rejects withSOCIAL_AUTH_UNSUPPORTED_PLATFORM.- Browser fallback is an application concern. This plugin only performs native auth and returns deterministic success or failure.
Commands
plugin:social-auth|apple_sign_inplugin:social-auth|google_sign_inplugin:social-auth|vk_sign_inplugin:social-auth|yandex_sign_in
Success payloads
Apple:
Google:
VK ID:
Yandex:
Install
Add the Rust dependency:
[]
= "1"
Register the plugin:
Declare commands for capability generation in src-tauri/build.rs:
Allow the default permission set in your capability file:
Configuration
iOS
The plugin reads provider configuration from SocialAuthConfig.plist.
Expected keys:
GOOGLE_SERVER_CLIENT_IDGOOGLE_IOS_CLIENT_IDVK_IOS_CLIENT_IDVK_IOS_CLIENT_SECRETYA_IOS_CLIENT_ID
You also need:
- Apple capability
Sign in with Apple - entitlement
com.apple.developer.applesignin = ["Default"] - URL schemes for Google, VK ID, and Yandex if you use those SDKs
LSApplicationQueriesSchemesentries required by the linked provider SDKs
macOS
Only apple_sign_in is implemented natively on macOS.
You need:
- Apple capability
Sign in with Apple - entitlement
com.apple.developer.applesignin = ["Default"]
Android
Expected app configuration:
GOOGLE_SERVER_CLIENT_IDinBuildConfig- current VK ID and Yandex SDK setup used by your app
apple_sign_in is intentionally unsupported on Android.
JavaScript usage
import { invoke } from '@tauri-apps/api/core';
export async function signInWithApple() {
return invoke<{
idToken: string;
userIdentifier: string;
authorizationCode?: string;
email?: string;
givenName?: string;
familyName?: string;
}>('plugin:social-auth|apple_sign_in');
}
export async function signInWithGoogle() {
return invoke<{ idToken: string }>('plugin:social-auth|google_sign_in');
}
export async function signInWithVk(theme?: 'light' | 'dark') {
return invoke<{ accessToken: string }>('plugin:social-auth|vk_sign_in', theme ? { theme } : undefined);
}
export async function signInWithYandex() {
return invoke<{ accessToken: string }>('plugin:social-auth|yandex_sign_in');
}
Error codes
Common:
SOCIAL_AUTH_UNSUPPORTED_PLATFORM
Apple:
APPLE_AUTH_CANCELEDAPPLE_AUTH_FAILEDAPPLE_ID_TOKEN_EMPTY
Google:
GOOGLE_AUTH_CANCELEDGOOGLE_SIGN_IN_INIT_FAILEDGOOGLE_SIGN_IN_FAILEDGOOGLE_ID_TOKEN_EMPTYGOOGLE_CREDENTIAL_MANAGER_FAILEDGOOGLE_UNSUPPORTED_CREDENTIALGOOGLE_AUTH_IOS_SDK_MISSING
VK ID:
VK_AUTH_CANCELEDVK_AUTH_INIT_FAILEDVK_AUTH_FAILEDVK_ACCESS_TOKEN_EMPTYVK_AUTH_IOS_SDK_MISSINGVK_AUTH_IOS_URL_SCHEME_MISSING
Yandex:
YANDEX_AUTH_CANCELEDYANDEX_AUTH_INIT_FAILEDYANDEX_AUTH_FAILEDYANDEX_ACCESS_TOKEN_EMPTYYANDEX_AUTH_IOS_SDK_MISSINGYANDEX_AUTH_IOS_URL_SCHEME_MISSING
Notes
- This plugin was fully developed with the help of AI.
- iOS and macOS native bridges are implemented in Swift.
- Android keeps native SDK flows for Google, VK ID, and Yandex.
- macOS intentionally exposes only Apple Sign-In natively.
License
MIT or Apache-2.0.