Before you start
- A LINE Official Account connected to the app. It must be the account the app sends messages from (the default one, if the app has more than one). See Connect LINE.
- LINE turned on as a sign-in method for the app. See User Authentication.
- A public app. Internal apps and internal surfaces can’t be opened in LINE. Only public ones can use a MINI App.
- The latest platform version. If your app is behind, the setup card asks you to update the app and deploy it to production first.
- A country where LINE offers MINI Apps. That’s Japan, Thailand and Taiwan, and your company’s country must match.
- A custom domain, if you plan to use one. Until LINE verifies your MINI App, customers see your app’s address in its header, so a domain of your own looks better than the default one. If you change domains later, update the address in the LINE console too. See Custom domains.
Connect your MINI App
You’ll find the setup under the app’s Settings → Authentication tab, in a card called Open in LINE. The card only appears when LINE is enabled as a sign-in method.1
Create a MINI App channel in LINE
In the LINE Developers Console, open the same provider as your
Official Account and create a LINE MINI App channel. LINE doesn’t let a channel move to
another provider later, so if you pick the wrong one you’ll need to create a new channel.
2
Paste your app's address into LINE
Copy the Endpoint URL from the Open in LINE card. In the console, open the MINI App’s
Web app settings and paste it into Published. If your MINI App isn’t verified yet, paste
it into Developing too.
3
Set scopes and link your account
Set the scopes to
openid and profile. Link your Official Account and turn on the add-friend
option, so customers can add your account when they first open the app.4
Paste the LIFF ID into Stardeck
Copy the Published LIFF ID from the console. It looks like
1234567890-AbCdEfGh. Paste it
into the card and click Save.5
Scan the QR code on your phone
The card shows a QR code and a pending status. Add your Official Account as a friend on your
phone first, then scan the code. Setup is finished when you get a LINE sign-in connected
message from your account, and the status changes from Pending to Live.
If it stays pending
Setup only finishes when LINE confirms that your Official Account knows the person who opened the link. These are the usual reasons it doesn’t:- You haven’t added your Official Account as a friend on the phone you scanned with.
- You blocked the account on that phone.
- The MINI App sits in a different LINE provider than your Official Account. Check the provider in the console. If it’s wrong, create a new MINI App channel in the right one, since channels can’t move.
Use the MINI App link in your rich menu
Once the status is Live, the card shows a link in the formhttps://miniapp.line.me/{liffId}. Add a path to open a specific page, for example /account, and copy the result into your rich menu button.
This replaces the older portal link from User Authentication. The old link keeps working as a fallback for people on a regular browser, and the LINE portal link card shows it under Browser fallback.
The LINE button on your app’s sign-in page also goes through the MINI App once it’s connected.
What customers see
- A consent screen the first time they open it. LINE shows this for MINI Apps that aren’t verified. You can apply for verification in the LINE console.
- They’re signed in automatically when they open your app inside LINE.
- Existing accounts are kept. If someone who already has an account opens the app in LINE while signed in, their LINE account is linked to it, so their bookings and history stay with them. A person with no account gets a new one.
- An add-friend option from LINE, since you turned it on in setup. Signing in doesn’t depend on it.
For builders
You don’t write code for sign-in. In your app,session.user.lineUserId holds the LINE user ID from your own provider, and it’s the ID your Official Account sends to. If your app needs LINE features such as closing the window or sharing, ask the agent for them and it uses the useLiff() hook that comes with the authentication package.
Never trust a LINE user ID that the browser sends to your backend. Anyone can fake it. Use the ID on the signed-in session instead.
Your app can tell whether the customer has added your account, so it can show a dismissible “Add us on LINE to get updates” prompt. The app doesn’t show one by default. To add it, describe it in the project chat:
Next steps
Connect LINE
Link your Official Account and grant it to your apps
User Authentication
Sign-in methods and LINE portal links