gadgetSuccess
gadgetSuccess(
data):string
Defined in: gadgets/helpers.ts:70
Create a success response as JSON string.
This is a convenience helper for gadgets that return JSON-formatted responses.
It automatically adds success: true and stringifies the result.
Parameters
Section titled “Parameters”Record<string, unknown> = {}
Additional data to include in the response
Returns
Section titled “Returns”string
JSON string with success: true and provided data
Example
Section titled “Example”return gadgetSuccess({ url: page.url(), title: await page.title() });// Returns: '{"success":true,"url":"...","title":"..."}'