# 取得目前使用者

> 傳回目前通過驗證之使用者的相關資訊。
> Canonical HTML: https://tursodb.cn/zh-tw/docs/api-reference/user/get-current/
> Upstream Source (MIT): https://docs.turso.tech/api-reference/user/get-current
> Language: zh-TW

---
```bash cURL
curl -L https://api.turso.tech/v1/user \
  -H 'Authorization: Bearer TOKEN'
```

```ts Node.js
import { createClient } from "@tursodatabase/api";

const turso = createClient({
  org: "...",
  token: "",
});

const user = await turso.users.getCurrent();
```


## OpenAPI

````yaml GET /v1/user
openapi: 3.0.1
info:
  title: Turso Platform API
  description: 此處為 API 說明
  license:
    name: MIT
  version: 0.1.0
servers:
  - url: https://api.turso.tech
    description: Turso 的平台 API
security: []
paths:
  /v1/user:
    get:
      summary: 取得目前使用者
      description: 傳回目前通過驗證之使用者的相關資訊。
      operationId: getCurrentUser
      responses:
        '200':
          description: 成功回應
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    type: object
                    properties:
                      username:
                        type: string
                        description: 使用者的使用者名稱。
                        example: iku
                      name:
                        type: string
                        description: 使用者的顯示名稱。
                        example: Iku Turso
                      email:
                        type: string
                        description: 使用者的主要電子郵件地址。
                        example: iku@turso.tech
                      avatarUrl:
                        type: string
                        description: 使用者頭像圖片的 URL。
                        example: https://avatars.githubusercontent.com/u/12345
                      plan:
                        type: string
                        description: 使用者目前的方案。
                        example: scaler
                      mfa:
                        type: boolean
                        description: >-
                          指出使用者是否已啟用多重要素驗證。
                        example: false
                      has_pending_invites:
                        type: boolean
                        description: >-
                          指出使用者是否有尚待接受或拒絕的組織邀請。
                        example: false

````
