Reference / @getenginex/sdk/extension / ExtensionRequestSpec
ExtensionRequestSpec<T>
Description of a request made by a product package via ExtensionTransport.request. Stable contract: new fields only come in as optional.
Example
transport.request({
method: 'POST',
path: `/casino/games/${encodeURIComponent(gameId)}/launch`,
body: { mode: 'real' },
auth: 'required',
validation: 'strict',
schema: launchSchema(),
options,
})Type Parameters
T
T
Properties
auth?
optionalauth?:ExtensionAuthMode
Session use. Default: 'none'.
body?
optionalbody?:unknown
Body, in wire format (snake_case), serialized as JSON. A FormData goes as multipart (the runtime sets the Content-Type with the boundary; the hooks receive only the field names and the type and size of the files) — requires core >=0.4.0.
idempotent?
optionalidempotent?:boolean
true sends an Idempotency-Key header: the one from options.idempotencyKey (the app passes it to repeat the operation without duplicating it) or, without it, one generated per call; either way it is reused on the retry after a renewed 401. With false, options.idempotencyKey is ignored. For routes that move money or create resources and that the gateway protects with the idempotency middleware. Default: false.
method
method:
HttpMethod
HTTP method.
options?
optionaloptions?:CallOptions
Call options received by the public method (signal, fetchOptions), passed on as they are.
path
path:
string
Path after /api/v1, starting with /, e.g. /casino/games. Segments coming from the app (ids) must go through encodeURIComponent. No query string: use query. A segment that, decoded and trimmed, is . or .. (the URL would normalize it to another route) rejects with INVALID_ARGUMENT (status: 0) before any fetch.
query?
optionalquery?:Record<string,ExtensionQueryValue>
Query string, in wire format (snake_case). undefined/null values are omitted.
schema
schema:
ZodMiniType<T>
Response schema, without the { success, data, meta } envelope (see wire).
validation?
optionalvalidation?:"strict"
'strict' makes this request throw VALIDATION_ERROR when the response does not match the schema, even with the client on validation: 'warn'. Use it on routes that return tokens, secrets or session URLs (e.g. a game's launch). Without it, the client's validation applies.