Javascript SDK
REST API Javascript Binding for Cros
Prerequisites
An API key is required for connecting to our REST API or equivalent SDKs. Get a free API key on our website home page at cros.one.
Technical Requirements
Node.js >= 16
How to Install
Install the Cros SDK via npm:
npm install cros-sdkConfiguration
Provide your API key for authentication. This can be set as an environment variable:
process.env.CROS_API_KEY = "your-api-key";Alternatively, pass the API key directly to the CrosClient:
import { CrosClient } from "cros-sdk";
const client = new CrosClient({ apiKey: "your-api-key" });Using the SDK
Start a Session
Start a new session:
Close a Session
Close the current session:
Observe a Webpage
Observe the state of a webpage:
Example Output:
Step Through Actions
Execute an action on the observed page:
Scrape Data
Scrape data from a page:
Example Output:
Managed API Services
We offer managed cloud browser sessions with the following premium add-ons:
Authentication: Built-in authentication for secure workflows.
Caching: Fast responses with intelligent caching.
Action Permissions: Control over sensitive actions.
Request access to a set of API keys on Cros.
Last updated