Sign in with LINE
Connect your own LINE MINI App so customers are signed in automatically inside LINE and your Official Account can message them.
By default, a customer who signs in to your app with LINE gets a LINE user ID from Stardeck's LINE provider. LINE gives each person a different ID under each provider, so your Official Account doesn't recognize that ID and can't send that customer a message.
To fix this, create a LINE MINI App in the same LINE provider as your Official Account and connect it to your app. Customers who open your app inside LINE are then signed in with an ID your account can message. Customers who already have an account keep it.
Setup takes one copy, one paste and one scan on your phone. You don't need to change your app.
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.
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.
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.
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.
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.
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 you have more than one public surface, each one has its own section in the card and needs its own MINI App.
Your coding agent can do the Stardeck side over the MCP server: it reads each surface's endpoint URL and saves the LIFF ID you give it, after you confirm. The LINE console steps and the QR scan stay with you.
Stuck on Pending? Check that the phone has added (and not blocked) your Official Account, and that the MINI App is in the same LINE provider as the account.
Use the MINI App link in your rich menu
Once the status is Live, the card shows a link in the form https://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.
Unverified MINI Apps show a LINE consent screen on first open. Customers who haven't added or have blocked your account still receive no messages.
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 your coding agent for them. It uses the useLiff() hook from the authentication package (@stardeck-customer-apps/project-auth), which its SKILL.md documents.
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, ask your coding agent or describe it in the app's Build tab:
If someone opens the app in LINE and hasn't added our account yet, show a small dismissible prompt to add us