Turso Cloud API 参考 接口资源 用户
获取当前用户
返回当前已认证用户的信息。
GET
https://api.turso.tech/v1/user curl -L https://api.turso.tech/v1/user \
-H 'Authorization: Bearer TOKEN'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const user = await turso.users.getCurrent();
OpenAPI
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
同步自官方 Turso 文档仓库 (
tursodatabase/turso-docs
· MIT 开源协议)
查看官方原文 ↗