SDK Installation
The official Scrayle SDK for Node.js (TypeScript/JavaScript). Wraps all API endpoints and provides direct browser automation integration.
Install
npm install @scrayle/sdkOr with other package managers:
pnpm add @scrayle/sdk
yarn add @scrayle/sdkRequirements
- Node.js 18+ (ES Modules support)
- TypeScript 5.0+ (optional but recommended)
Quick Setup
import { ScrayleClient } from '@scrayle/sdk';
// Reads SCRAYLE_API_KEY from environment
const client = new ScrayleClient();
// Or configure explicitly
const client = new ScrayleClient({
apiKey: 'your-api-key',
timeout: 60000,
});Environment Variables
| Variable | Description | Default |
|---|---|---|
SCRAYLE_API_KEY | API authentication key | Required |
SCRAYLE_HUB | Compute hub: eu, us, asia | eu |
SCRAYLE_IS_ONLINE | Use HTTP storage (true) or local storage (false) | false |
LOG_LEVEL | Logging level: trace, debug, info, warn, error | info |
Package Exports
// Main client
import { ScrayleClient, Scrayle } from '@scrayle/sdk';
// Browser automation
import { Playwright, Puppeteer, SeleniumBrowser } from '@scrayle/sdk';
// Error class
import { ScrayleError } from '@scrayle/sdk';
// Utilities
import { sleep, retry, log, createLogger } from '@scrayle/sdk';Peer Dependencies
For browser automation, install the corresponding library:
# For Playwright
npm install playwright-core
# For Puppeteer
npm install puppeteer-core
# Selenium is included in the SDKNext Steps
- ScrayleClient - Client configuration and services
- Browser Service - Create browser sessions
- Scraping Service - Scraping and SERP APIs
- Error Handling - Handle SDK errors