import { ApifyClient } from "apify-client" import * as z from "zod" const APIFY_SECRET_SCHEMA = z.object({ apiKey: z.string().min(1) }) /** * Creates the official authenticated Apify API client. * * @param secret - Resolved Apify account secret. */ export function getApifyClient(secret: Record) { return new ApifyClient({ token: APIFY_SECRET_SCHEMA.parse(secret).apiKey }) }