jpskill.com
🛠️ 開発・MCP コミュニティ

line-liff

LINEアプリ内で動作するウェブアプリ開発を支援するLINE Front-end Framework (LIFF) SDKに関する質問に対応し、認証、メッセージ送信、QRコード読み取り、パーマネントリンク作成、プラグイン開発など、LIFFに関するあらゆる疑問を解決するSkill。

📜 元の英語説明(参考)

Comprehensive reference for LINE Front-end Framework (LIFF) SDK — building web apps inside LINE with authentication, messaging, QR scanning, permanent links, pluggable SDK, and LIFF plugin development. This skill should be used when the user asks to "build a LIFF app", "initialize liff.init()", "send messages from LIFF", "use Share Target Picker", "scan a QR code in LIFF", "create a permanent link", "develop a LIFF plugin", or mentions LIFF SDK, LINE Front-end Framework, CDN/npm integration, pluggable SDK tree-shaking, LIFF-to-LIFF transitions, LIFF browser vs external browser, Endpoint URL configuration, or server-side ID token verification from LIFF. Always use this skill whenever the user mentions LIFF, web apps inside LINE, or LINE Front-end Framework, even if they don't explicitly say "LIFF SDK".

🇯🇵 日本人クリエイター向け解説

一言でいうと

LINEアプリ内で動作するウェブアプリ開発を支援するLINE Front-end Framework (LIFF) SDKに関する質問に対応し、認証、メッセージ送信、QRコード読み取り、パーマネントリンク作成、プラグイン開発など、LIFFに関するあらゆる疑問を解決するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o line-liff.zip https://jpskill.com/download/8829.zip && unzip -o line-liff.zip && rm line-liff.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/8829.zip -OutFile "$d\line-liff.zip"; Expand-Archive "$d\line-liff.zip" -DestinationPath $d -Force; ri "$d\line-liff.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して line-liff.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → line-liff フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

LINE LIFF (フロントエンドフレームワーク)

LIFFに関する質問に記憶だけで答えないでください。LINEはAPIを頻繁に更新しており、トレーニングデータは信頼できません。常に以下の参考文献を参照してください。

LINE内でLIFFウェブアプリを構築、レビュー、デバッグするためのリファレンスです。

ワークフロー

構築

  1. references/guidelines.md を読む(登録、エンドポイントURLのルール、環境の互換性)
  2. 実装する機能に関連するリファレンスを読み込む
  3. アーキテクチャまたは設計の選択については、references/experts.md で方向性のガイダンスを参照する
  4. リファレンスの仕様と制約に従ってコードを書く

レビュー / デバッグ

  1. references/guidelines.md を読む(URLの制約、認証フロー、APIの可用性)
  2. レビューするコードに関連するリファレンスを読み込む
  3. コードを仕様と照らし合わせて確認する(エンドポイントURLのルール、スコープの要件、環境の制限、初期化の順序)
  4. デザインパターンの懸念事項については、references/experts.md を参照する
  5. 特定の制約への違反を指摘する

環境変数

LIFF_ID=LIFF アプリ ID (LINE Developers Console から)
LINE_LOGIN_CHANNEL_ID=LINE Login Channel ID (サーバーサイドの JWT 検証用)
LINE_LOGIN_CHANNEL_SECRET=Channel secret (サーバーサイドのみ)
CHANNEL_ACCESS_TOKEN=Channel access token (LIFF Server API 用 — LIFF アプリをプログラムで管理)

SDK

CDNまたはnpm経由でインストールします。ツリーシェイキング(バンドルサイズを約34%削減)には、プラガブルSDKを使用します。

SDKのインストール、CDN/npmの設定、プラガブルSDK → references/api.md § Pluggable SDK

初期化

liff.init({ liffId: 'YOUR_LIFF_ID', withLoginOnExternalBrowser: true })
  .then(() => { /* use LIFF APIs */ })
  .catch(err => console.error(err.code, err.message));
  • すべてのLIFF APIの前に呼び出す必要があります(初期化前のメソッドを除く)
  • withLoginOnExternalBrowser: true — 外部ブラウザで自動的にログインをトリガー
  • liff.ready — 初期化が完了したときに解決される Promise

はじめに

  1. LINE Developers ConsoleLINE Login channel を作成する
  2. LIFF app を追加し、Endpoint URL を設定する(HTTPS必須)
  3. SDKを統合し、liff.init() を呼び出す
  4. または、npx @line/create-liff-app でスキャフォールドする (React/Vue/Svelte/Next.js/Nuxt/vanilla)

コアAPI概要

認証とプロフィール

メソッド 説明 スコープ
liff.isLoggedIn() ログイン状態を確認
liff.login() ログインをトリガー (外部ブラウザのみ)
liff.logout() ログアウト
liff.getProfile() userId, displayName, pictureUrl を取得 profile
liff.getDecodedIDToken() デコードされた JWT (email など) を取得 openid + email
liff.getIDToken() 生の JWT を取得 (サーバー検証用) openid
liff.getFriendship() リンクされた OA との友だち関係を確認 profile

メッセージング

メソッド 説明 制限
liff.sendMessages([...]) 現在のチャットに送信 (最大5件) LIFF ブラウザのみ
liff.shareTargetPicker([...]) 共有する友だち/グループを選択 最初に isApiAvailable を確認

デバイスとナビゲーション

メソッド 説明
liff.scanCodeV2() QRコードスキャナー (Console で有効にする)
liff.openWindow({url, external}) URL を開く
liff.closeWindow() LIFF を閉じる (外部ブラウザでは信頼できない)

コンテキスト

メソッド 説明
liff.getContext() type, userId, groupId, roomId, viewType を取得
liff.getOS() 'ios', 'android', 'web'
liff.isInClient() LINE アプリで実行されているかどうか
liff.permanentLink.createUrlBy(url) 永続的なリンクを作成

ビューサイズ

タイプ カバー範囲
Full 画面の100%
Tall 約75%
Compact 約50%

主な制約

  • Endpoint URL: liff.init() は、登録された Endpoint URL 以下でのみ動作します
  • URL handling: URL の変更は liff.init() が解決された後のみ行ってください
  • Universal Links: https://liff.line.me/{liffId} をプライマリのエントリーポイントとして使用してください
  • Token security: 検証のために生の ID Token をサーバーに送信し、デコードされたトークンを公開しないでください → server-auth.md を参照してください
  • Login behavior differs: LIFF ブラウザでは自動、外部ブラウザでは手動
  • Deprecated APIs: liff.scanCode()scanCodeV2() を使用してください; liff.getLanguage()getAppLanguage() を使用してください; liff.permanentLink.createUrl()createUrlBy() を使用してください (v3 で削除される可能性があります)

リファレンスインデックス

ファイル トピック
references/api.md LIFF v2 API の完全なリファレンス、プラガブル SDK モジュール、エラーコード
references/guidelines.md 登録、エンドポイントURLのルール、認証フロー、UI/UX、環境の互換性
references/navigation.md LIFF URL、liff.state、永続的なリンク、LIFF-to-LIFF のトランジション、ブラウザの最小化
references/plugins.md LIFF プラグインの開発、フックシステム、公式プラグイン (Inspector, Mock)
references/server-api.md LIFF Server API (v1) — LIFF アプリのプログラムによる CRUD (作成、更新、リスト、削除)
references/server-auth.md サーバーサイドの ID Token (JWT) 検証
references/cli.md LIFF CLI — ローカル HTTPS 開発サーバー、アプリの CRUD、Inspector デバッグ、ngrok
references/experts.md アーキテクチャのガイダンスを提供する LIFF ドメインのエキスパート

SDK & ツール

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

LINE LIFF (Front-end Framework)

Do not answer LIFF questions from memory — LINE updates APIs frequently and training data is unreliable. Always consult the references below.

Reference for building, reviewing, and debugging LIFF web apps inside LINE.

Workflow

Build

  1. Read references/guidelines.md (registration, endpoint URL rules, environment compatibility)
  2. Load the relevant reference for the feature being implemented
  3. For architecture or design choices, consult references/experts.md for directional guidance
  4. Write code following specs and constraints from references

Review / Debug

  1. Read references/guidelines.md (URL constraints, authentication flow, API availability)
  2. Load relevant references for the code being reviewed
  3. Cross-check code against specs (endpoint URL rules, scope requirements, environment limitations, init order)
  4. For design pattern concerns, consult references/experts.md
  5. Report violations with reference to specific constraints

Environment Variables

LIFF_ID=LIFF app ID (from LINE Developers Console)
LINE_LOGIN_CHANNEL_ID=LINE Login Channel ID (for server-side JWT verification)
LINE_LOGIN_CHANNEL_SECRET=Channel secret (server-side only)
CHANNEL_ACCESS_TOKEN=Channel access token (for LIFF Server API — manage LIFF apps programmatically)

SDK

Install via CDN or npm. For tree-shaking (reduce ~34% bundle size), use pluggable SDK.

SDK installation, CDN/npm setup, pluggable SDK → references/api.md § Pluggable SDK

Initialization

liff.init({ liffId: 'YOUR_LIFF_ID', withLoginOnExternalBrowser: true })
  .then(() => { /* use LIFF APIs */ })
  .catch(err => console.error(err.code, err.message));
  • Must be called before all LIFF APIs (except pre-init methods)
  • withLoginOnExternalBrowser: true — auto-trigger login in external browser
  • liff.ready — Promise that resolves when init completes

Getting Started

  1. Create a LINE Login channel in LINE Developers Console
  2. Add a LIFF app and set the Endpoint URL (HTTPS required)
  3. Integrate SDK, call liff.init()
  4. Or scaffold with npx @line/create-liff-app (React/Vue/Svelte/Next.js/Nuxt/vanilla)

Core API Summary

Authentication & Profile

Method Description Scope
liff.isLoggedIn() Check login status
liff.login() Trigger login (external browser only)
liff.logout() Log out
liff.getProfile() Get userId, displayName, pictureUrl profile
liff.getDecodedIDToken() Get decoded JWT (email, etc.) openid + email
liff.getIDToken() Get raw JWT (for server verification) openid
liff.getFriendship() Check friendship with linked OA profile

Messaging

Method Description Restriction
liff.sendMessages([...]) Send to current chat (max 5) LIFF browser only
liff.shareTargetPicker([...]) Pick friends/groups to share Check isApiAvailable first

Device & Navigation

Method Description
liff.scanCodeV2() QR code scanner (enable in Console)
liff.openWindow({url, external}) Open URL
liff.closeWindow() Close LIFF (unreliable in external browser)

Context

Method Description
liff.getContext() Get type, userId, groupId, roomId, viewType
liff.getOS() 'ios', 'android', 'web'
liff.isInClient() Whether running in LINE app
liff.permanentLink.createUrlBy(url) Create permanent link

View Sizes

Type Coverage
Full 100% screen
Tall ~75%
Compact ~50%

Key Constraints

  • Endpoint URL: liff.init() only works at or below the registered Endpoint URL
  • URL handling: modify URLs only after liff.init() resolves
  • Universal Links: use https://liff.line.me/{liffId} as primary entry point
  • Token security: send raw ID Token to server for verification, never expose decoded token → see server-auth.md
  • Login behavior differs: auto in LIFF browser, manual in external browser
  • Deprecated APIs: liff.scanCode() → use scanCodeV2(); liff.getLanguage() → use getAppLanguage(); liff.permanentLink.createUrl() → use createUrlBy() (may be removed in v3)

Reference Index

File Topic
references/api.md LIFF v2 API complete reference, pluggable SDK modules, error codes
references/guidelines.md Registration, endpoint URL rules, authentication flow, UI/UX, environment compatibility
references/navigation.md LIFF URLs, liff.state, permanent links, LIFF-to-LIFF transitions, browser minimization
references/plugins.md LIFF plugin development, hooks system, official plugins (Inspector, Mock)
references/server-api.md LIFF Server API (v1) — programmatic LIFF app CRUD (create, update, list, delete)
references/server-auth.md Server-side ID Token (JWT) verification
references/cli.md LIFF CLI — local HTTPS dev server, app CRUD, Inspector debugging, ngrok
references/experts.md LIFF domain experts for architecture guidance

SDK & Tools