Skip to main content
The Spidra NestJS integration (spidra-nestjs) provides a native NestJS module and injectable service for the Spidra platform:
  • SpidraModule.forRoot() & forRootAsync(): Dynamic module registration with sync or async configuration (e.g. via ConfigService).
  • SpidraService: Injectable service with typed accessors and dynamic proxy delegation for all 70+ Spidra client methods.
  • @InjectSpidra(): Parameter decorator to inject the underlying SpidraClient.
  • SpidraWebhookGuard: Controller guard that verifies HMAC-SHA256 signatures on incoming asynchronous webhooks.

Installation

Requires Node.js 18+ and NestJS 9+.
Get your API key from app.spidra.io under API Keys. Store it in your environment or NestJS ConfigService. Never hardcode keys.

Configuration

Import SpidraModule into your root AppModule:

Synchronous configuration

Asynchronous configuration (with ConfigService)

Quickstart

1. In a service

Inject SpidraService into any provider or controller:

2. In a controller with Webhook Guard

Protect webhook receiver endpoints with SpidraWebhookGuard:

Scraping & browser actions

Deep site crawling

Parallel batch scraping & streaming watchers

Domain mapping

Document parsing (PDF, Word, Excel)

Turnkey templates & monitors

Error handling

Express

Express.js middleware, turnkey router, and error handling.

Fastify

Fastify high-performance plugin and route decoration.