Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Statsig

Scalekit connector
Open markdown

The Statsig connector lets your AI agent act in each user's Statsig account. Each user connects their own Statsig API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 96 tools.

Tools
96
What they doRead · write · destructive
53 · 35 · 853 read35 write8 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Statsig connection

    In AgentKit > Connections, create a Statsig connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'statsig'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Statsig:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'statsig_audit_overrides',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Statsig credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • statsig_audit_overridesList the gates, experiments and layers that have overrides, optionally narrowed to one unit ID.Read-only

    Audit Overrides

    List the gates, experiments and layers that have overrides, optionally narrowed to one unit ID. Returns each entity with overrides and the overridden IDs and groups. Use statsig_audit_overrides to find every override affecting a user. Use statsig_get_gate_overrides or statsig_get_experiment_overrides for one entity.

    Inputs

    id_typestring
    Unit ID type that unit_id refers to, such as userID or stableID. Example: userID.
    unit_idstring
    Unit ID to audit. When set, only entities that override this ID are returned. Example: user_123.
  • statsig_get_alertGet one topline metric alert by ID.Read-only

    Get Topline Alert

    Get one topline metric alert by ID. Returns the alert's name, metric, condition, thresholds, schedule, subscribers and mute status. Use statsig_get_alert for one known alert. Use statsig_list_alerts to find alert IDs.

    Inputs

    alert_idstringrequired
    ID of the topline alert, as returned by statsig_list_alerts. Example: 6Yt2cVb8kq1LmNoPqRsTuv.
  • statsig_get_dashboardGet one dashboard by ID.Read-only

    Get Dashboard

    Get one dashboard by ID. Returns the dashboard's name, description and widget definitions. Use statsig_get_dashboard for one known dashboard. Use statsig_list_dashboards to find dashboard IDs.

    Inputs

    dashboard_idstringrequired
    ID of the dashboard, as returned by statsig_list_dashboards. Example: 3kLmN8pQrS2tUvWxYz1AbC.
  • statsig_get_dynamic_configGet one dynamic config by ID.Read-only

    Get Dynamic Config

    Get one dynamic config by ID. Returns the config's name, description, isEnabled, defaultValue, rules with return values, schema, tags and owner. Use statsig_get_dynamic_config for one known config. Use statsig_list_dynamic_configs to find config IDs.

    Inputs

    dynamic_config_idstringrequired
    ID of the dynamic config, as returned by statsig_list_dynamic_configs. Example: pricing_page_config.
  • statsig_get_eventList recently logged events for one event name.Read-only

    Get Recent Events by Name

    List recently logged events for one event name. Covers a limited rolling window, not full history. Returns recent records for that event with value, metadata, user and timestamp, plus pagination info. Use statsig_get_event to inspect one event's payloads. Use statsig_list_events for all events.

    Inputs

    event_namestringrequired
    Name of the logged event. Example: add_to_cart.
    limitinteger
    Number of results to return per page. Example: 20.
    pageinteger
    Page number to return, starting at 1. Use with limit to page through results. Example: 2.
  • statsig_get_experimentGet one experiment by ID.Read-only

    Get Experiment

    Get one experiment by ID. Returns the experiment's full setup: name, hypothesis, status, groups with parameter values, allocation, layer, targeting gate, metrics, statistical settings and dates. Use statsig_get_experiment for one known experiment. Use statsig_get_experiment_pulse_results for its metric results.

    Inputs

    experiment_idstringrequired
    ID of the experiment, as returned by statsig_list_experiments. Example: checkout_button_color_test.
  • statsig_get_experiment_cumulative_exposuresGet cumulative exposure counts for an experiment's groups over time.Read-only

    Get Experiment Cumulative Exposures

    Get cumulative exposure counts for an experiment's groups over time. Returns daily cumulative exposure counts per group. Use statsig_get_experiment_cumulative_exposures to check enrollment balance. Use statsig_get_experiment_pulse_results for metric impact.

    Inputs

    experiment_idstringrequired
    ID of the experiment, as returned by statsig_list_experiments. Example: checkout_button_color_test.
  • statsig_get_experiment_overridesGet the overrides that force users, gates or segments into specific groups of an experiment.Read-only

    Get Experiment Overrides

    Get the overrides that force users, gates or segments into specific groups of an experiment. Returns the gate and segment overrides and the user ID overrides with their target groups. Use statsig_get_experiment_overrides to see forced assignments. Use statsig_update_experiment_overrides to add them.

    Inputs

    experiment_idstringrequired
    ID of the experiment, as returned by statsig_list_experiments. Example: checkout_button_color_test.