
Every Apify Actor run starts cold — stateless, no memory of who is running it or what accounts it should use. The moment you want the Actor to write scraped results into a customer's own Notion workspace, pull analytics from their YouTube channel, or send messages from their Gmail, you hit the classic production problem: how do you give the Actor the right credentials without hard-coding secrets or forcing every user to share one account?
Scalekit's connected-accounts model solves this for Apify. You use Apify's own userId as the stable identifier. Scalekit stores and refreshes the OAuth tokens per user (or per shared connector). Your Actor code simply checks whether the user is connected and then calls the service through Scalekit.
The result is an Actor you can safely offer to multiple customers or team members. Each person authorizes once, and every future run uses their own permissions and data.
You can prototype an Apify Actor with one set of credentials and get useful work done quickly. The transition point comes the first time you want the same Actor to serve real users or customers:
At that stage you need per-user authentication and authorization. Rolling your own OAuth, token storage, and refresh logic turns the Actor into a side project. Scalekit removes that work so you can keep focusing on the actual automation or data task.
Apify provides the serverless runtime and a live-view port that can show users an interface while the run is active. Scalekit provides the OAuth layer and token management.
The key ideas:
This keeps your Actor code focused on the job while the identity and token handling live in one place.
Imagine you built an Actor that scrapes public sources and then creates or updates pages in Notion. In testing you might use one integration token. That works until the first customer says "I want the output in my workspace."
With Scalekit you treat Notion as a per-user connector:
The same Actor can use a shared YouTube connection for read-only research data that doesn't need to be scoped per user. You choose per connector.
Printing a raw magic link into logs or JSON creates friction. Apify Actors can run a small HTTP server on the live-view port. The Scalekit integration can serve a simple branded page that says "Authorize Notion" with a clear button.
The customer clicks, completes the flow in their browser, and the page updates to "Authorized — returning to task." The Actor can poll in the background and continue automatically once the connection is active.
It's a small detail, but it turns a copy-paste-and-wait step into something that feels like a normal product flow.
You don't manage tokens yourself. The shape looks like this (cleaned from the official cookbook):
If you later need more than session data (organization details, other Scalekit APIs, etc.), you can reach the full Scalekit SDK from inside the same authenticated context.
The reference implementation shows the full pattern in one place:
https://github.com/scalekit-developers/agentkit-apify-actor-example
It includes:
Clone it, add your Scalekit and Apify credentials, and run it. The Actor will prompt for authorization on first use and then run with the correct user context thereafter.
More details are in the Scalekit cookbook and Apify documentation.
Apify gives you a clean way to run tasks at scale. Scalekit gives you a clean way to give those tasks the right identity. You keep the Actor focused on the actual work (scrape this, transform that, write the result) while the auth and token management are handled in one place.
The outcome is an Actor you can confidently share with customers or run on behalf of different people without them ever seeing each other's data or credentials. This approach aligns with access control for multi-tenant AI agents, ensuring each user's data stays isolated.
Create a Scalekit account and set up your first connection at scalekit.com.
If you move fast with AI coding agents, the quickest way to add the integration is:
Try it out!