line_push/node_modules/@line/liff/README.md
2022-07-17 13:16:16 +08:00

1.9 KiB

LINE Front-end Framework

LINE Front-end Framework (LIFF) is a platform for web apps provided by LINE. The web apps running on this platform are called LIFF apps.

LIFF apps can get data from the LINE Platform such as the LINE user ID. The LIFF app can use such data to provide features that utilize user information and send messages on the user's behalf.

Installation

Using npm

$ npm install --save @line/liff

Using yarn

$ yarn add @line/liff

Note: It is the developer's responsibility to use an appropriate SDK version. To keep your SDK version up to date, check the LIFF release notes on a regular basis, and update your local SDK frequently. For more information about LIFF's versioning policy, see LIFF SDK (sdk.js) update policy.

Usage

Include the SDK in your JavaScript or TypeScript files:

import liff from '@line/liff';

liff.init({ liffID: 'myLiffId' });

Type definitions for TypeScript are already included in the @line/liff package

Warning

For backward compatibility, please do not declare or modify the global LIFF instance window.liff. Declaring or modifying window.liff may cause malfunctioning of the LINE app.

CDN

The LIFF SDK is also available on LINE's CDN.

<script src="https://static.line-scdn.net/liff/edge/versions/2/sdk.js"></script>

See integrating LIFF for more details.

Documentation

See LIFF Document and API Reference.

License

Using LIFF means you agree to the LINE Developers Agreement.