> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kavachos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LINE

> Authenticate users via LINE OAuth 2.0 with `lineProvider()`. Create a LINE Login channel and configure `openid`, `profile`, and `email` scopes.

## Setup

<Steps>
  <Step>
    ### Get credentials

    Go to the [LINE Developers Console](https://developers.line.biz) and create a provider and channel. Choose **LINE Login** as the channel type. Add your redirect URI:

    ```
    https://your-app.com/api/kavach/auth/oauth/callback/line
    ```
  </Step>

  <Step>
    ### Configure

    ```ts title="lib/kavach.ts" theme={"system"}
    import { createKavach } from 'kavachos';
    import { oauth } from 'kavachos/auth';
    import { lineProvider } from 'kavachos/auth';

    const kavach = await createKavach({
      database: { provider: 'sqlite', url: 'kavach.db' },
      plugins: [
        oauth({
          providers: [
            lineProvider(
              process.env.LINE_CLIENT_ID!,
              process.env.LINE_CLIENT_SECRET!,
            ),
          ],
        }),
      ],
    });
    ```

    ```bash theme={"system"}
    LINE_CLIENT_ID=...
    LINE_CLIENT_SECRET=...
    ```
  </Step>
</Steps>

## Scopes

Default scopes: `openid`, `profile`, `email`

| Scope     | What it unlocks                                    |
| --------- | -------------------------------------------------- |
| `openid`  | OIDC identity token                                |
| `profile` | Display name and profile picture                   |
| `email`   | Email address (requires email permission approval) |

<Info>
  The `email` scope requires an additional approval step in the LINE Developer Console. You must agree to the LINE Login email permission terms and submit for review.
</Info>

## Endpoints

| Method | Path                         | Description      |
| ------ | ---------------------------- | ---------------- |
| GET    | `/auth/oauth/authorize/line` | Redirect to LINE |
| GET    | `/auth/oauth/callback/line`  | Handle callback  |
