Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Quickstart

Make your first AgentKit tool call in Python, Node.js or cURL: install the SDK, add your credentials, and call GitHub as yourself.

Connect your own GitHub account and make your first tool call as that user. New Scalekit environments include a GitHub connection, so there’s nothing to set up in GitHub. About 10 minutes.

Using a coding agent?

  • A Scalekit account at app.scalekit.com
  • Python 3.10+, Node.js 18.14+, or curl and jq
  • Your environment URL, client ID and client secret. Open Developers > Settings > API Credentials: copy the Environment URL and Client ID from Environment details, then select Generate new secret under Client secrets. The secret is shown once, so copy it right away. See API credentials.
  • The GitHub connection name from AgentKit > Connections. New environments call it github-connect.
  1. Terminal window
    pip install scalekit-sdk-python python-dotenv
  2. Create a .env file next to your script. Don’t commit it.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<client-id>
    SCALEKIT_CLIENT_SECRET=<client-secret>
    GITHUB_CONNECTION_NAME=github-connect
  3. Save this as agent.py, agent.ts or agent.sh. It connects the user if needed, then calls GitHub as them.

    agent.py
    import os
    from dotenv import load_dotenv
    from scalekit import ScalekitClient
    load_dotenv()
    scalekit_client = ScalekitClient(
    env_url=os.environ["SCALEKIT_ENVIRONMENT_URL"],
    client_id=os.environ["SCALEKIT_CLIENT_ID"],
    client_secret=os.environ["SCALEKIT_CLIENT_SECRET"],
    )
    actions = scalekit_client.actions
    connection_name = os.environ["GITHUB_CONNECTION_NAME"]
    user_id = "user_123" # your app's ID for this user: stable and hard to guess
    # Find this user's connected account, or create it on the first run
    account = actions.get_or_create_connected_account(
    connection_name=connection_name,
    identifier=user_id,
    ).connected_account
    if account.status != "ACTIVE":
    link = actions.get_authorization_link(
    connection_name=connection_name,
    identifier=user_id,
    ).link
    print(f"Open this link and approve access:\n{link}")
    input("Press Enter when you're done...")
    account = actions.get_connected_account(
    connection_name=connection_name,
    identifier=user_id,
    ).connected_account
    if account.status != "ACTIVE":
    raise SystemExit(f"The account is {account.status}, not ACTIVE. Run the script again.")
    # Call GitHub as this user. The tool is read-only.
    result = actions.execute_tool(
    tool_name="github_user_get_authenticated",
    tool_input={},
    connected_account_id=account.id,
    )
    print(result.data)

    user_123 stands in for your app’s user ID. Choose an identifier explains what to use in production.

  4. Terminal window
    python agent.py

    The first run prints a link. Open it, approve access on GitHub, then press Enter. You’ll see your GitHub profile. Run it again: the account is already ACTIVE, so the script skips the link.

GITHUB_CONNECTION_NAME doesn’t match the dashboard exactly. Copy it again from AgentKit > Connections.

The approval wasn’t finished, or the link expired. Links last five minutes by default. Run the script again for a fresh link.

user_verify_url is required when user_verify_mode is b2b

Section titled “user_verify_url is required when user_verify_mode is b2b”

User verification is set to Custom user verifier, so the link request needs a verify URL. For this quickstart, use None or Scalekit users only in AgentKit > Settings > User Verification. To set up the custom user verifier, see Verify users.

KeyError: 'SCALEKIT_ENVIRONMENT_URL' or TypeError: Invalid URL

Section titled “KeyError: 'SCALEKIT_ENVIRONMENT_URL' or TypeError: Invalid URL”

The .env file wasn’t loaded. Run the script from the folder that contains it.

The client ID or secret is wrong, or the secret was regenerated.

Before real users connect accounts, verify users.

API reference

The endpoints this page's code calls, with every field and the SDK method for each: