Loading...
Loading...
Load this skill for any up-fetch task: `up(fetch, getDefaultOptions?)`, `upfetch(url, options?)`. Covers dynamic defaults, auth, request shaping, validation, error handling, lifecycle timing, and runtime caveats.
npx skill4agent add l-blondy/up-fetch upfetchup-fetchup(fetchFn, getDefaultOptions?)getDefaultOptions(input, options, ctx)upfetch(input, options?, ctx?)SKILL.mdreferences/import { up } from 'up-fetch'
import { z } from 'zod'
export const upfetch = up(fetch, () => ({
baseUrl: 'https://api.example.com',
headers: {
Authorization: readToken() ? `Bearer ${readToken()}` : undefined,
},
timeout: 5000,
}))
const user = await upfetch('/users/1', {
schema: z.object({
id: z.number(),
name: z.string(),
}),
})up()paramsbodyschemareject: () => falseparseResponseglobalThis.fetchundici.fetch