agentql JavaScript SDK reference
The agentql
module provides utility methods to set configurations, including the API key, and to convert Playwright's Page
to AgentQL's Page
, which gives access to AgentQL's querying API.
The following example demonstrates how to set the API key and wrap a Playwright Page
object to use AgentQL's querying capabilities:
Methods
wrap
Wraps a Playwright Page
instance to add AgentQL's querying methods. See AgentQL Page reference for API details.
Usage
Arguments
page
Playwright's Page
Returns
- Promise<AgentQL Page> - The wrapped Page object with AgentQL extensions.
configure
Configures the AgentQL service.
Usage
Arguments
options
(object) - The configuration options. Supports the following options:apiKey
(string) - The API key for the AgentQL service.