forked from daren.hsu/line_push
51 lines
1.9 KiB
Markdown
51 lines
1.9 KiB
Markdown
# 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](https://developers.line.biz/en/docs/liff/release-notes/#liff-version-and-release-date) 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](https://developers.line.biz/en/docs/liff/versioning-policy/#update-policy).
|
|
|
|
## Usage
|
|
|
|
Include the SDK in your JavaScript or TypeScript files:
|
|
```ts
|
|
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.
|
|
|
|
```html
|
|
<script src="https://static.line-scdn.net/liff/edge/versions/2/sdk.js"></script>
|
|
```
|
|
|
|
See [integrating LIFF](https://developers.line.biz/en/docs/liff/developing-liff-apps/#integrating-sdk) for more details.
|
|
|
|
## Documentation
|
|
See [LIFF Document](https://developers.line.biz/en/docs/liff/) and [API Reference](https://developers.line.biz/en/reference/liff/).
|
|
|
|
## License
|
|
Using LIFF means you agree to the [LINE Developers Agreement](https://terms2.line.me/LINE_Developers_Agreement).
|