@line/liff-main-profile-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

@line/liff-main-profile-plugin

A LIFF Plugin to get and auto-fill forms main profile data from Account Center.

How to use

CDN

CDN versions of packages is hosted in TBD and can be imported using the script tag as shown below.

index.html

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/src/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="TBD"></script>
    <title>LIFF App</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/index.js"></script>
  </body>
</html>

The package is then defined in the global object with the name liffMainProfile. So you can use the package as a LIFF Plugin as follows in the js/ts file.

index.js

liff.use(new liffMainProfile.LiffMainProfilePlugin());
await liff.init({ liffId: "xxx" });

const profile = await liff.$mainProfile.get();
liff.$mainProfile.fill(profile);

npm

npm install @line/liff-main-profile-plugin`
import { LiffMainProfilePlugin } from "@line/liff-main-profile-plugin";

liff.use(new LiffMainProfilePlugin());
await liff.init({ liffId: "xxx" });

const profile = await liff.$mainProfile.get();
liff.$mainProfile.fill(profile);

Readme

Keywords

none

Package Sidebar

Install

npm i @line/liff-main-profile-plugin

Weekly Downloads

1

Version

0.0.2

License

none

Unpacked Size

7.73 kB

Total Files

5

Last publish

Collaborators

  • odanado
  • kazuma0129
  • cola119
  • okamoto.takuya
  • sugarshin
  • linecorp