Each API function is an async function written in typescript. As an input, it user-passed and runtime params and returns a json object. Here is it what you get when you create a new API file:
Copy
Ask AI
// Standard playwright BrowserContext and Pageimport { BrowserContext, Page } from "playwright-core";// a Utility function to extend the playwright page with the Intuned Helpersimport { extendPlaywrightPage } from "@intuned/sdk/playwright";interface Params { // Add your params here}export default async function handler( params: Params, _playwrightPage: Page, context: BrowserContext) { const page = extendPlaywrightPage(_playwrightPage); // Add your code here return {};}
The extendPlaywrightPage method extends the playwright page with helpers from `@intuned/sdk. These helpers facilitate faster and more reliable browser automation. For more information, please refer to the Automation SDKs reference.
The result can be any serializable JSON object, and will be returned to the API consumer. If the result is not serializable, the function will throw an error.