Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Fairing

Scalekit connector
Open markdown

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

Tools
2
What they doRead · write · destructive
2 · 0 · 02 read0 write0 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 Fairing connection

    In AgentKit > Connections, create a Fairing 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 = 'fairing'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Fairing:', 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: 'fairing_list_questions',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Fairing 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
  • fairing_list_questionsList the questions in your Fairing question stream, including answer options and follow-up questions.Read-only

    List Questions

    List the questions in your Fairing question stream, including answer options and follow-up questions. Returns a data array of questions (id, prompt, type, customer_type, frequency_type, answer options, published_at and timestamps). Use to find a question_id before calling fairing_list_responses, or to review the survey configuration.

    Inputs

    include_targetingboolean
    Set to true to include each question's targeting rules in the result. Defaults to false.default false
  • fairing_list_responsesList customer survey responses collected by Fairing, with order, customer, attribution and UTM details for each answer.Read-only

    List Responses

    List customer survey responses collected by Fairing, with order, customer, attribution and UTM details for each answer. Returns a data array of response records (response id, question and answer text, order id and total, customer email, UTM fields, timestamps) plus prev and next page URLs. Use to pull answers to post-purchase questions; filter by question_id or time window. Use fairing_list_questions to look up question IDs and wording.

    Inputs

    ending_beforestring
    Pagination cursor: the id of the first response from the current page. Returns the page before it. Cannot be combined with starting_after. Example: pk9ZDChjMNueWHZqHEF5Z.
    inserted_at_maxstring
    ISO 8601 UTC timestamp. Return only responses created at or before this time. Example: 2026-05-31T23:59:59Z.
    inserted_at_minstring
    ISO 8601 UTC timestamp. Return only responses created at or after this time. Example: 2026-05-01T00:00:00Z.
    limitinteger
    Number of responses to return per page, from 1 to 1000. Defaults to 100 when omitted. Example: 100.
    question_idinteger
    Return only responses to the question with this numeric ID. Get IDs from fairing_list_questions. Example: 11.
    sortstring
    Result ordering. One of inserted_at_desc (newest first, the default), inserted_at_asc, updated_at_desc, updated_at_asc. Cursors walk in the active sort direction.one of inserted_at_descinserted_at_ascupdated_at_descupdated_at_asc
    starting_afterstring
    Pagination cursor: the id of the last response from the previous page. Returns the page after it. Cannot be combined with ending_before. Example: ENz45Kvbxru0B5X6kDN7Y.
    updated_at_maxstring
    ISO 8601 UTC timestamp. Return only responses last updated at or before this time. Example: 2026-05-31T23:59:59Z.
    updated_at_minstring
    ISO 8601 UTC timestamp. Return only responses last updated at or after this time; useful for finding responses recategorized in Fairing. Example: 2026-05-01T00:00:00Z.