Skip to content
Scalekit Docs
Talk to an EngineerDashboard

Blog

Build a Mastra agent with Scalekit AgentKit tools

Mastra agents need tools. Each third-party API — Gmail, Slack, Calendar — means another OAuth flow, another token store, another refresh cycle. This recipe connects a Mastra agent to Scalekit AgentKit tools using the Node SDK, with automatic authorization and token refresh.

Trace AgentKit tool calls in LangSmith

Scalekit AgentKit returns native LangChain StructuredTool objects. Enable LangSmith tracing and every tool call — Gmail fetches, Slack messages, GitHub searches — appears as a traced span automatically. This recipe walks through setup, a working agent, and verifying traces in the LangSmith dashboard.

Apify Actor with per-user OAuth via Scalekit

Apify Actors run in isolated containers with no persistent session — there is no concept of “who is logged in.” This recipe shows how to use Apify’s built-in user identity as the key into Scalekit’s OAuth token vault, so each user who runs your Actor connects their own third-party accounts, and tokens survive across runs without any user-managed input fields.

M2M JWT verification with JWKS and OAuth scopes

Machine-to-machine access tokens are JWTs signed by Scalekit. Your API verifies signatures using the published JWKS at /keys, then authorizes requests using the scopes embedded in each token. This cookbook ties those ideas together end to end.