SDK ReferenceTypeScript SDK

Client

Instantiate and configure the Bytekit TypeScript client.

Client

The Bytekit TypeScript SDK is a thin, type-safe wrapper over the REST API. Create a client with your API key, then call resource methods.

import { RapidCrawl } from '@rapidcrawl/sdk';

const client = new RapidCrawl({
  apiKey: process.env.RAPIDCRAWL_API_KEY!, // sk_live_… or sk_test_…
});

Options (RapidCrawlOptions)

  • apiKey (required) — string
  • baseUrlstring Defaults to https://api.bytekit.com.

Resources

The client exposes one property per resource:

Errors

Any non-2xx response throws a RapidCrawlError carrying the HTTP status and the API code.

import { RapidCrawl, RapidCrawlError } from '@rapidcrawl/sdk';

try {
  await client.scrape.create({ url: 'https://example.com' });
} catch (err) {
  if (err instanceof RapidCrawlError) {
    console.error(`${err.status} ${err.code}: ${err.message}`);
  }
}