Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Spotlightr

Scalekit connector
Open markdown

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

Tools
15
What they doRead · write · destructive
6 · 8 · 16 read8 write1 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 Spotlightr connection

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

    Each user opens the link once and enters their Spotlightr 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
  • spotlightr_domains_listList the domains whitelisted to embed your Spotlightr videos.Read-only

    List Whitelisted Domains

    List the domains whitelisted to embed your Spotlightr videos. Returns the whitelisted domains. Use spotlightr_domain_add to allow another domain.

    Inputs

    This tool takes no inputs.

  • spotlightr_groups_listList the projects (video groups) in your Spotlightr account.Read-only

    List Projects

    List the projects (video groups) in your Spotlightr account. Returns projects with their id and name. Use this to find a project ID for spotlightr_videos_list or spotlightr_video_create.

    Inputs

    This tool takes no inputs.

  • spotlightr_top_videos_listList your most-viewed videos over a recent period.Read-only

    List Top Videos

    List your most-viewed videos over a recent period. Returns the top videos with their view statistics. Use this for a quick performance overview. Use spotlightr_video_metrics_get for one video.

    Inputs

    daysinteger
    Reporting period in days. Spotlightr defaults to 30. Example: 30.
    totalinteger
    Number of top videos to return. Spotlightr defaults to 3. Example: 5.
  • spotlightr_video_metrics_getGet analytics for one video.Read-only

    Get Video Metrics

    Get analytics for one video. Returns loads, plays, playRate, watched (average percent watched), completitionRate and shares. Use spotlightr_video_views_list for individual views.

    Inputs

    video_idintegerrequired
    Numeric Spotlightr video ID (the decoded ID, not the base64 string in watch URLs). Get it from spotlightr_videos_list. Example: 1352090.
  • spotlightr_video_views_listList the individual views of a video, optionally for one known viewer or only views where something was watched.Read-only

    List Video Views

    List the individual views of a video, optionally for one known viewer or only views where something was watched. Returns view records with viewer and watch-progress details. Use spotlightr_video_metrics_get for totals.

    Inputs

    video_idintegerrequired
    Numeric Spotlightr video ID (the decoded ID, not the base64 string in watch URLs). Get it from spotlightr_videos_list. Example: 1352090.
    all_viewsboolean
    true to return all views without pagination. Example: false.
    custom_viewer_idstring
    ID or email of a known viewer to return views for. Example: jane@example.com.
    only_watchedboolean
    true to return only views with more than 1 percent watched. Example: true.
  • spotlightr_videos_listList the videos in your Spotlightr account, optionally narrowed to one video or one project.Read-only

    List Videos

    List the videos in your Spotlightr account, optionally narrowed to one video or one project. Returns video records with their id, name, project (videoGroup), URLs and settings. Use this to find video IDs. Use spotlightr_video_metrics_get for a video's analytics.

    Inputs

    video_groupinteger
    Return only videos in this project (group) ID, from spotlightr_groups_list. Example: 4521.
    video_idinteger
    Return only this video. Example: 1352090.
  • spotlightr_access_expireExpire a student's course access record.Write

    Expire Access Record

    Expire a student's course access record. Returns the update result. Use this to revoke a student's access to a course.

    • Idempotent

    Inputs

    expireintegerrequired
    Set to 1 to expire the record. Example: 1.one of 1
    idintegerrequired
    Access record ID. Example: 55021.
  • spotlightr_domain_addAdd a domain to the list allowed to embed your Spotlightr videos.Write

    Add Whitelisted Domain

    Add a domain to the list allowed to embed your Spotlightr videos. Returns the result. Use spotlightr_domains_list to see the current list.

    • Idempotent

    Inputs

    domainstringrequired
    Domain to whitelist, without protocol. Example: example.com.