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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wisdomgarden/capacitor-plugin-line-login

v0.0.2

Published

A capacitor plugin for line login

Readme

WisdomGarden Line Login

A Capacitor 2 plugin that provides LINE Login for iOS and Android using the official LINE SDK.
Supports access token retrieval, user profile information, and login error handling.

  • Android: LINE SDK 5.11.1
  • iOS: LINE SDK Swift 5.9.x
  • Web is not supported in this plugin

Compatible with:

  • iOS 11+
  • Android 9.0+
  • Capacitor 2.x

📦 Installation

npm install @wisdomgarden/capacitor-plugin-line-login
npx cap sync

or

yarn install @wisdomgarden/capacitor-plugin-line-login
npx cap sync

🔧 Configuration

Android Setup

Step 1: Register the plugin in MainActivity (Capacitor 2.x only)

Edit android/app/src/main/java/<your.package>/MainActivity.java:

// Add import
import com.wisdomgarden.plugins.linelogin.LineLoginPlugin;

// Inside onCreate(), add to the plugin list:
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
    // ... other plugins
    add(LineLoginPlugin.class);
}});

iOS Setup

Step 1: Edit Info.plist (ios/App/App/Info.plist)

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        </array>
    </dict>
</array>

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>lineauth2</string>
</array>

Step 2: Update AppDelegate.swift (ios/App/App/AppDelegate.swift)

import LineSDK

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
    // Line SDK handle url
    if LoginManager.shared.application(app, open: url, options: options) {
        return true
    }
    // Line SDK handle url complete

    // Capacitor existing code at the end of the function
    return CAPBridge.handleOpenUrl(url, options)
}

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
    // Line SDK handle url
    if LoginManager.shared.application(application, open: userActivity.webpageURL) {
        return true
    }
    // Line SDK handle url complete

    // Called when the app was launched with an activity, including Universal Links.
    // Feel free to add additional processing here, but if you want the App API to support
    // tracking app url opens, make sure to keep this call
    return CAPBridge.handleContinueActivity(userActivity, restorationHandler)
  }

Note: The plugin's podspec (WisdomgardenCapacitorPluginLineLogin.podspec) automatically brings in LineSDK so you only need to ensure the main project imports and initializes AppDelegate.

📝 API

initialize

initialize(options: LineLoginConfig): Promise<void>;

Initialize the plugin

Parameters:

  • options: LineLoginConfig

Returns: Promise<void>


login

login(): Promise<LoginUserResult>;

Trigger LINE login flow

Returns: Promise<LoginUserResult>

Throws: LineLoginError


Interface

LineLoginConfig

| Prop | Type | Description | | --- | --- | --- | | channelId | string | LINE Channel IDIdentifies your LINE application. Required.Must be set before calling login(). | | universalLink | string | Optional Universal Link URL for iOS.If provided, the plugin will use this URL to handleUniversal Link callbacks for LINE login.Example: "https://yourdomain.com/line-auth/"Required only for iOS apps using Universal Links. |

AccessTokenInfo

| Prop | Type | Description | | --- | --- | --- | | token | string | Access token returned after login, used to call LINE APIs | | userId | string | Unique ID of the logged-in user | | exp | number | Expiration time of the access token (Unix epoch seconds) |

UserInfo

| Prop | Type | Description | | --- | --- | --- | | id | string | User ID, same as accessToken.userId | | name | string \| null | Display name of the user. May be null if not set. | | email | string \| null | User's email. Available if email scope was requested and authorized. | | pictureUrl | string \| null | URL of the user's profile picture. Null if not set. |

LoginUserResult

| Prop | Type | Description | | --- | --- | --- | | accessToken | AccessTokenInfo | Access token information | | userInfo | UserInfo | User information |

LineLoginError

| Prop | Type | Description | | --- | --- | --- | | code | string | Error code indicating the type of failure.Possible values include:- USER_CANCELLED — The user manually cancelled the login flow.- PARSE_ERROR — Failed to parse the login result returned by the SDK.- LINE_LOGIN_FAILED — General login failure due to other reasons. | | message | string | Human-readable description of the error.This can be displayed to the user or logged for debugging. |

🔨 Usage

// use in web
import { WisdomGardenLineLogin } from '@wisdomgarden/capacitor-plugin-line-login';
// use in native
import { Plugins } from '@capacitor/core';

const { WisdomGardenLineLogin } = Plugins;
import {
  type LineLoginError,
  type LoginUserResult,
} from "@wisdomgarden/capacitor-plugin-line-login";

// Initialize the plugin
WisdomGardenLineLogin.initialize({
  channelId: 'YOUR_LINE_CHANNEL_ID',
});

// Trigger login flow
try {
    const { accessToken, userInfo } = await WisdomGardenLineLogin.login();

    console.log('userId:', accessToken.userId);
    console.log('name:', userInfo?.name, 'email:', userInfo?.email);
} catch (e) {
    const err = e as LineLoginError;
    console.log(err.code,err.message);
}