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

react-native-line-auth

v0.1.0

Published

Standalone React Native bridge for LINE Login using the official LINE iOS and Android SDKs.

Readme

react-native-line-auth

Standalone LINE Login for React Native using the official native LINE SDKs directly.

  • No dependency on another React Native LINE Login npm package
  • Android: official com.linecorp.linesdk:linesdk
  • iOS: official LineSDKSwift
  • Typed TypeScript API
  • React Native autolinking

Requirements

  • React Native 0.76 or newer
  • Android API 24 or newer
  • iOS 13.0 or newer
  • A LINE Login channel

Install

Install this package only:

npm install react-native-line-auth

For iOS, install pods:

cd ios
pod install
cd ..

The package automatically adds the official native LINE SDK through Gradle on Android and CocoaPods on iOS. You do not install another LINE Login npm package.

LINE Developers Console

Create or open a LINE Login channel and configure both platforms.

Android

Register:

  • Your Android application ID, for example com.example.myapp
  • Your production and debug package signatures as needed

The package requires minSdkVersion 24 or later. If your project uses a lower value, update it in the application Android configuration.

iOS

Register:

  • Your iOS bundle identifier
  • Universal Link settings when your application uses them

Add the following values to the application Info.plist:

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    </array>
  </dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>lineauth2</string>
</array>

iOS AppDelegate setup

The LINE SDK must be initialized when the iOS application launches so that cold-start login callbacks can be processed.

In AppDelegate.swift, import LINE SDK and React linking:

import LineSDK
import React

Add LINE setup inside your existing application(_:didFinishLaunchingWithOptions:) implementation:

LoginManager.shared.setup(
  channelID: "YOUR_LINE_LOGIN_CHANNEL_ID",
  universalLinkURL: nil
)

Forward URL callbacks to the LINE SDK before the React Native linker:

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

  return RCTLinkingManager.application(
    app,
    open: url,
    options: options
  )
}

Keep your application’s existing AppDelegate logic and merge these lines into it rather than replacing the entire file.

Basic usage

Configure once near application startup:

import { configureLineLogin } from 'react-native-line-auth';

await configureLineLogin({
  channelId: 'YOUR_LINE_LOGIN_CHANNEL_ID',
});

Sign in:

import {
  Scope,
  isLineLoginCancelled,
  signInWithLine,
} from 'react-native-line-auth';

try {
  const result = await signInWithLine({
    scopes: [Scope.Profile, Scope.OpenId],
  });

  console.log(result.user);
  console.log(result.accessToken);
  console.log(result.idToken);
} catch (error) {
  if (!isLineLoginCancelled(error)) {
    console.error(error);
  }
}

Sign out:

import { signOutFromLine } from 'react-native-line-auth';

await signOutFromLine();

Send login to your backend

The npm package does not know your backend URL. Keep backend calls inside your application:

const line = await signInWithLine();

const response = await fetch('https://api.example.com/auth/line', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    accessToken: line.accessToken,
    idToken: line.idToken,
  }),
});

Your backend must verify the token with LINE before trusting the user identity or creating an application session. Do not trust userId, displayName, or other profile values sent by the client without server-side verification.

Login options

import { BotPrompt, Scope, signInWithLine } from 'react-native-line-auth';

const result = await signInWithLine({
  scopes: [Scope.Profile, Scope.OpenId, Scope.Email],
  nonce: 'cryptographically-random-nonce',
  botPrompt: BotPrompt.Normal,
  onlyWebLogin: false,
});

Scope.Email requires email permission to be enabled for the LINE Login channel.

API

Authentication

configureLineLogin(options): Promise<void>
signInWithLine(options?): Promise<LineAuthResult>
signOutFromLine(): Promise<void>
isLineLoginConfigured(): boolean

Tokens and profile

getCurrentLineAccessToken(): Promise<LineAccessToken>
refreshLineAccessToken(): Promise<LineAccessToken>
verifyLineAccessToken(): Promise<LineTokenVerification>
getLineProfile(): Promise<LineAuthUser>
getLineFriendshipStatus(): Promise<LineFriendshipStatus>

Error handling

import {
  LINE_LOGIN_CANCELLED,
  LineAuthError,
  isLineLoginCancelled,
} from 'react-native-line-auth';

Native cancellation codes from iOS and Android are normalized to LOGIN_CANCELLED.

Returned login result

interface LineAuthResult {
  accessToken: string;
  expiresIn: number;
  issuedAt: number | null;
  expiresAt: number | null;
  idToken: string | null;
  idTokenNonce: string | null;
  grantedScopes: string[];
  user: {
    userId: string;
    displayName: string;
    pictureUrl: string | null;
    statusMessage: string | null;
  } | null;
  friendshipStatusChanged: boolean | null;
}

Token timestamps are Unix seconds.

Native dependencies

This npm package has no third-party LINE npm dependency. Native dependency resolution is handled by each platform:

React Native application
        ↓
react-native-line-auth
        ↓
Official LINE SDK
  ├─ Android Maven: com.linecorp.linesdk:linesdk:5.12.0
  └─ iOS CocoaPods: LineSDKSwift 5.16.x

Troubleshooting

Native module is not linked

Rebuild the application after installation. For iOS, run pod install first.

Android login returns AUTHENTICATION_AGENT_ERROR

Check the Android package name and package signature registered in the LINE Developers Console.

iOS opens LINE but does not return to the app

Check the URL scheme in Info.plist and confirm that AppDelegate forwards the URL to LoginManager.shared.application(...).

Login works after reopening the app but not from a cold start

Initialize LoginManager.shared in AppDelegate during application launch, not only from JavaScript.

Development

npm ci
npm run check
npm pack --dry-run

License

MIT