TabSailTabSail

Export a business report

Sign in, complete MFA through Live view, and retrieve a validated CSV.

This example uses your own Snipe-IT instance. The local acceptance fixture pins Snipe-IT 8.8.3 and Puppeteer 25.15.0, with synthetic assets and a dedicated test account.

Password login → Live MFA → Fresh CDP grant → CSV → Validate → Release

Install the TypeScript SDK artifact and [email protected] using Quickstart. The reusable helper is examples/sdk/typescript/snipeit-report.ts in the source distribution.

With that helper in the same directory, save as report.ts:

import { writeFile } from 'node:fs/promises';
import { TabSail } from 'tabsail';
import { snipeReport } from './snipeit-report.js';

const client = new TabSail();
await client.withSession({ timeoutSeconds: 900 }, async (session) => {
  const result = await snipeReport(client, session.id,
    process.env.SNIPEIT_URL!,
    { username: process.env.SNIPEIT_USERNAME!, password: process.env.SNIPEIT_PASSWORD! },
    async ({ sessionId }) => {
      console.log('Open this session in the console:', sessionId);
      console.log('Complete MFA in Live control, then return to automation.');
    },
  );
  if (!result.csv.includes('Asset Tag')) throw Error('Unexpected report');
  await writeFile('report.csv', result.csv);
  await writeFile('report-configuration.pdf', result.pdf);
});

Provide the three SNIPEIT_* values in your application environment. Install tsx with pnpm add -D tsx, then run pnpm exec tsx report.ts. Keep passwords in your backend; only the person supplies MFA. Validate the expected business rows before accepting the result.

The helper preserves the website tab, waits for the completed handoff, reconnects with a fresh grant, exports Asset Name / Asset Tag / Serial, and retrieves the CSV through the session Files API. Its PDF and screenshot capture the report configuration page; the CSV contains the business rows. The SDK scope releases the browser on success or failure.

For repeat visits, add a Profile and verify its save result after release. Website login expiry still requires a new sign-in.

Run the isolated source fixture

From the repository root with Docker and the pinned Node / uv toolchains:

BUSINESS_AGENT_MODE=scripted mise exec -- corepack pnpm test:business

The fixture creates its own site and test data, exercises real Live control with a simulated person, validates the CSV, PDF and login reuse, then removes its resources. It makes no model calls. Do not change security settings on a shared public demo.

A separate real-model run passed with Browser Use 0.13.11 and gpt-6-luna: one Agent/run, two Live handoffs, preserved report columns, exact CSV validation, and verified release. Use the tested model configuration; operator input remains simulated through Live control. Real-model runs require an explicitly selected model endpoint and approved fixture payload.

On this page