Skip to main content

src/lib/apiBase

creatorvault-miniapp


creatorvault-miniapp / src/lib/apiBase

src/lib/apiBase

Type Aliases

ApiFetchInit

ApiFetchInit = RequestInit & object

Defined in: lib/apiBase.ts:7

Type Declaration

withCredentials?

optional withCredentials: boolean

Functions

apiAliasPath()

apiAliasPath(path): string

Defined in: lib/apiBase.ts:14

Parameters

path

string

Returns

string


apiFetch()

apiFetch(path, init, bases?): Promise<Response>

Defined in: lib/apiBase.ts:38

Fetch an API route with a best-effort alias fallback:

  • try /__api/* first (to avoid extension blocks on /api/*)
  • then fall back to /api/*

If bases is provided, the function will try each base origin in order.

Parameters

path

string

init

ApiFetchInit = {}

bases?

string[]

Returns

Promise<Response>