UNPKG

cloudflare-client

Version:
23 lines (22 loc) 639 B
/* SPDX-FileCopyrightText: 2022-present Kriasoft */ /* SPDX-License-Identifier: MIT */ import { baseUrl, createFetch, HttpMethod } from "./fetch.js"; // #endregion /** * The currently logged in / authenticated User * @see https://api.cloudflare.com/#user-properties */ export function user(credentials) { const url = `${baseUrl}/user`; return { /** * The currently logged in/authenticated user * @see https://api.cloudflare.com/#user-properties */ get: createFetch(() => ({ method: HttpMethod.GET, url, credentials, })).response(), }; }