Skip to content
← Public packages

@apphub/netlify

Inspect Netlify sites, deploys, env-var metadata, and forms on the caller's account, with dry-run writes.

src/request.js

17 lines · 749 B · JavaScript
import { netlifyRequest } from './netlify.js'

/**
 * Call a Netlify REST endpoint using the caller's personal access token.
 * Prefer named helpers; use this for paths not wrapped by this package.
 * Mutating methods require `dryRun: true` or `confirm: true`.
 * @param {Object} [input]
 * @param {string} input.path Relative API path such as `/user` or `/sites`.
 * @param {boolean} [input.dryRun] Return the request preview without calling Netlify.
 * @returns {Promise<{ status: number, data: unknown } | { dryRun: true }>}
 * @example
 * import request from 'kody:@apphub/netlify/request'
 * const result = await request({ path: '/user' })
 */
export default async function requestEntrypoint(input = {}) {
	return await netlifyRequest(input)
}