# LINE Connection

The LINE connection lets you publish DailyPlay **streams** inside LINE using a
[LIFF](https://developers.line.biz/en/docs/liff/overview/) or
[LINE MINI App](https://developers.line.biz/en/docs/line-mini-app/discover/introduction/) channel.
Players open a permanent LINE link and play your campaign in LINE — no Messaging API or channel
secrets required.

:::note
LINE is a **publishing** connection, not an event webhook. It is not linked to stream trigger
events like Braze or Zapier. See [Connections overview](/connections/overview) for webhook
providers.
:::

---

## Prerequisites

| Requirement | Where to find it |
| :---------- | :--------------- |
| **LINE Developers account** | [LINE Developers Console](https://developers.line.biz/console/) |
| **LIFF app** (or LINE MINI App channel) | LINE Developers Console → your provider → LIFF / MINI App |
| **Public LIFF ID** | Shown on the LIFF (or MINI App) settings page — e.g. `1234567890-AbCdEfGh` |

:::tip
Prefer **Classic LIFF** (`liff.line.me`) when MINI App channel creation is unavailable — common in
Thailand. Use **LINE MINI App** (`miniapp.line.me`) only when you have an approved MINI App channel
(typically Japan / approved providers).
:::

---

## Setting Up the Connection

1. Go to **Connections** from the main navigation
2. Click **Add Connection** and choose **LINE (LIFF / MINI App)**
3. Enter:
   - **LIFF ID** (required) — your public LIFF ID only; do **not** paste a channel secret or access token
   - **Link type** — Classic LIFF (recommended) or LINE MINI App
   - **LINE Basic ID** (optional) — e.g. `@yourbrand`
   - **Official Account page URL** (optional) — e.g. `https://page.line.me/…`
4. Save the connection

### Configure the Endpoint URL in LINE

In the LINE Developers Console, set your LIFF (or MINI App) **Endpoint URL** to:

```
https://app.dailyplay.ai/?liff_id=YOUR_LIFF_ID
```

Replace `YOUR_LIFF_ID` with the same LIFF ID you entered in DailyPlay. The `liff_id` query parameter
is required so DailyPlay can initialize LIFF before opening the stream.

Then ensure the LIFF app is **Added** (or publish your MINI App channel) in the LINE Developers
Console.

---

## Publishing a Stream to LINE

Once an active LINE connection exists for your organization:

1. Open the stream you want to publish
2. Open the **Share** options
3. Use the **Publish to LINE** panel:
   - Copy the **LINE permanent link**
   - Follow the setup checklist (Endpoint URL, LIFF/MINI App published, link added to OA)

### Permanent link format

| Link type | URL pattern |
| :-------- | :---------- |
| Classic LIFF | `https://liff.line.me/{liff_id}/stream/{org-slug}/{stream-slug}` |
| LINE MINI App | `https://miniapp.line.me/{liff_id}/stream/{org-slug}/{stream-slug}` |

### Add the link to your Official Account

Put the permanent link in your LINE Official Account **rich menu** or **rich message** so followers
can open the stream in one tap.

---

## Share on LINE

From a stream (or game) share panel you can also use **Share on LINE**:

- **Mobile** — Opens the LINE share sheet with a pre-filled message
- **Desktop** — Copies the message so you can paste it into LINE

When a LINE connection is active, the shared message uses the permanent LIFF/MINI App URL. Otherwise
it uses the normal stream (or game) URL.

:::note
Permanent **Publish to LINE** links are available for **streams**. Individual games support Share on
LINE only.
:::

---

## How It Works

1. A player opens the permanent LINE link (from your rich menu, a rich message, or a shared message)
2. LINE loads DailyPlay with your configured Endpoint URL and `liff.state`
3. DailyPlay initializes LIFF, then opens the stream path
4. The player plays the stream inside LINE

If LIFF initialization fails, or the player opens a normal `https://app.dailyplay.ai/stream/…` link
inside LINE’s in-app browser, the stream still loads as a regular web page.

---

## Managing the Connection

- **Edit** — Update LIFF ID, link type, Basic ID, or OA page URL from **Connections**
- **Enable / Disable** — Toggle the connection without deleting it (disabled connections hide the Publish to LINE panel)
- **Delete** — Permanently remove the LINE connection from your organization

:::note
Only organization **owners** and **admins** can create, edit, or delete connections.
:::

---

## Troubleshooting

### Publish to LINE panel does not appear

- Confirm you created a **LINE (LIFF / MINI App)** connection (not a webhook)
- Ensure the connection is **enabled**
- Open a **stream** share panel — permanent publish is stream-only

### Stream opens as a blank page in LINE

- Verify the Endpoint URL is exactly `https://app.dailyplay.ai/?liff_id=YOUR_LIFF_ID`
- Confirm the LIFF ID in DailyPlay matches the LIFF app in the LINE Developers Console
- Ensure the LIFF app is Added (or the MINI App channel is published)

### Permanent link opens but stream does not load

- Check that the org slug and stream slug in the URL are correct
- Confirm the stream is published / playable in DailyPlay
- Try opening the normal stream URL in a regular browser to isolate LINE-specific issues

### Share on LINE copies a message instead of opening LINE

- On desktop, LINE’s share URL is not supported — DailyPlay copies the message for you to paste
- On mobile, the LINE share sheet should open automatically

---

## Limitations

- No LINE Messaging API, push messages, or bot webhooks in this integration
- Channel secrets and access tokens are **not** stored — paste the public LIFF ID only
- LINE cannot be attached as a stream event sink (unlike Braze, Zapier, or webhooks)

---

## Next Steps

- [Connections overview](/connections/overview)
- [Streams overview](/streams/overview)
- [Share your game](/sharing/share)