diff --git a/README.md b/README.md index d0a1925..f4f9e0e 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,16 @@ You can also pass optional parameters and headers; the list above is a reference Sending headers to the target URL will overwrite our defaults. Be careful when doing it and contact us if there is any problem. +### Adaptive Stealth Mode + +Set `mode: "auto"` to let ZenRows pick the request configuration for you — it starts with the cheapest viable setup and escalates to `js_render`/`premium_proxy` only when the target needs it, billing only for the configuration that succeeds. + +```javascript +const response = await client.get(url, { mode: "auto" }); +``` + +Compatible with `proxy_country`, `js_instructions`, and `custom_headers`. + ### POST Requests The SDK also offers POST requests by calling the `client.post` method. It can receive a new parameter `data` that represents the data sent in, for example, a form. diff --git a/src/index.ts b/src/index.ts index de02b6e..1f55804 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,6 +35,10 @@ interface ClientConfig { retries?: number; } export interface ZenRowsConfig { + /** Set to "auto" to enable Adaptive Stealth Mode — ZenRows starts with the cheapest + * viable request configuration and escalates to js_render/premium_proxy only when the + * target needs it, billing only for the configuration that succeeds. */ + mode?: "auto"; autoparse?: boolean; css_extractor?: string; js_render?: boolean;