apify-sdk-patterns

Installation
SKILL.md

Apify SDK Patterns

Overview

Production patterns for both the apify SDK (building Actors) and apify-client (calling Actors remotely). Covers Crawlee crawler selection, data storage, proxy configuration, and typed client wrappers. This skill gives you the essential skeletons inline; the full eight-pattern catalog and two worked scenarios live in references/ for progressive drill-down.

Prerequisites

  • Install what you need: apify-client for calling Actors remotely, or apify + crawlee for building Actors. Both can coexist in one project.
  • Set APIFY_TOKEN in the environment — read it via process.env.APIFY_TOKEN, never hard-code it. This is the only credential these patterns require (Apify uses a personal API token, not OAuth).
  • TypeScript is recommended; every snippet here is typed and runs under ts-node or a compiled build.

Instructions

Use the two skeletons below to start, then reach into the reference catalog for the pattern that matches your task.

Pattern 1: Typed Client Singleton

Create one lazily-initialized, token-validated ApifyClient and reuse it everywhere. A resetClient() hook keeps it testable.

Installs
1
GitHub Stars
2.8K
First Seen
12 days ago
apify-sdk-patterns — jeremylongshore/tons-of-skills-marketplace