Skillshub apify-install-auth
install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/jeremylongshore/claude-code-plugins-plus-skills/apify-install-auth" ~/.claude/skills/comeonoliver-skillshub-apify-install-auth && rm -rf "$T"
manifest:
skills/jeremylongshore/claude-code-plugins-plus-skills/apify-install-auth/SKILL.mdsource content
Apify Install & Auth
Overview
Set up the Apify ecosystem: the
apify-client JS library (for calling Actors remotely), the apify SDK (for building Actors), the Apify CLI (for deploying), and Crawlee (for crawling). Each package serves a different purpose.
Package Map
| Package | npm | Purpose |
|---|---|---|
| | Call Actors, manage datasets/KV stores from external apps |
| | Build Actors (includes , ) |
| | Crawler framework (Cheerio, Playwright, Puppeteer crawlers) |
| | CLI for , , |
Prerequisites
- Node.js 18+ (required by SDK v3+)
- Apify account at https://console.apify.com
- API token from Settings > Integrations in Apify Console
Instructions
Step 1: Install Packages
# For CALLING existing Actors from your app: npm install apify-client # For BUILDING your own Actors: npm install apify crawlee # For CLI deployment: npm install -g apify-cli
Step 2: Configure Authentication
# Option A: Environment variable (recommended for apps) export APIFY_TOKEN="apify_api_YOUR_TOKEN_HERE" # Option B: .env file (add .env to .gitignore) echo 'APIFY_TOKEN=apify_api_YOUR_TOKEN_HERE' >> .env # Option C: CLI login (for interactive development) apify login # Paste your token when prompted
Step 3: Verify Connection
import { ApifyClient } from 'apify-client'; const client = new ApifyClient({ token: process.env.APIFY_TOKEN, }); // List your Actors to confirm auth works const { items } = await client.actors().list(); console.log(`Authenticated. You have ${items.length} Actors.`);
Step 4: Verify CLI (if installed)
apify login --token YOUR_TOKEN apify info # Shows your account info
Auth Token Details
- Token format:
prefix followed by alphanumeric stringapify_api_ - Pass via
header (REST API)Authorization: Bearer <token> - Pass via
constructor option (JS client)token - The
env var is auto-detected by bothAPIFY_TOKEN
andapify-client
SDKapify
Environment Variable Reference
| Variable | Purpose |
|---|---|
| API authentication (primary) |
| Proxy access (auto-set on platform) |
| when running on Apify platform |
| Default dataset for current run |
| Default KV store for current run |
| Default request queue for current run |
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Invalid or expired token | Regenerate token in Console > Settings > Integrations |
| Package not installed | |
| Missing env var | Export or pass to constructor |
| CLI not installed globally | |
Examples
TypeScript Project Setup
// src/apify/client.ts import { ApifyClient } from 'apify-client'; import 'dotenv/config'; // npm install dotenv let client: ApifyClient | null = null; export function getClient(): ApifyClient { if (!client) { if (!process.env.APIFY_TOKEN) { throw new Error('APIFY_TOKEN environment variable is required'); } client = new ApifyClient({ token: process.env.APIFY_TOKEN }); } return client; }
.env.example Template
# Apify — get your token at https://console.apify.com/account/integrations APIFY_TOKEN=apify_api_REPLACE_ME
Resources
Next Steps
Proceed to
apify-hello-world for your first Actor call.