
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@hanzi-browse/sdk
Advanced tools
SDK for the Hanzi browser automation platform. Control a real Chrome browser programmatically.
SDK for the Hanzi browser automation platform. Control a real Chrome browser programmatically — navigate, click, read pages, fill forms — powered by AI.
npm install @hanzi-browse/sdk
import { HanziClient } from '@hanzi-browse/sdk';
const client = new HanziClient({
apiKey: 'hic_live_xxx',
});
// Run a task (blocks until complete)
const result = await client.runTask({
browserSessionId: 'your-session-id',
task: 'Go to linkedin.com and check unread messages',
});
console.log(result.answer);
// "You have 3 unread messages from: Alice, Bob, Carol"
Sign in to open your developer console, then create an API key.
The browser you want to control needs the Hanzi Chrome extension installed and paired to your workspace.
// Your backend creates a pairing token
const { pairingToken } = await client.createPairingToken();
// Send the user a pairing link — they click it and their browser auto-pairs:
// https://api.hanzilla.co/pair/{pairingToken}
//
// Or embed the hanzi-pair.js snippet in your app for one-click pairing.
// Find connected browser sessions
const sessions = await client.listSessions();
const connected = sessions.find(s => s.status === 'connected');
// Run a task against that browser
const result = await client.runTask({
browserSessionId: connected.id,
task: 'Read the patient chart on the current page',
context: 'Extract: name, medications, allergies, problems',
});
console.log(result.answer);
console.log(result.usage); // { inputTokens, outputTokens, apiCalls }
new HanziClient(options)| Option | Type | Required | Default |
|---|---|---|---|
apiKey | string | Yes | — |
baseUrl | string | No | https://api.hanzilla.co |
client.runTask(params, options?)Run a task and wait for completion. This is the main method.
Params:
| Field | Type | Required | Description |
|---|---|---|---|
browserSessionId | string | Yes | Connected browser session |
task | string | Yes | What to do |
url | string | No | Starting URL |
context | string | No | Extra context (form data, preferences) |
Options:
| Field | Type | Default | Description |
|---|---|---|---|
pollIntervalMs | number | 2000 | How often to check status |
timeoutMs | number | 300000 | Max wait time (5 min) |
Returns: TaskRun with status, answer, steps, usage.
client.createTask(params)Start a task without waiting. Returns immediately.
client.getTask(taskId)Check status of a running task.
client.cancelTask(taskId)Cancel a running task.
client.createPairingToken()Create a pairing token for connecting a browser.
client.listSessions()List browser sessions in your workspace.
client.getUsage()Get usage summary (tokens, costs, task count).
client.health()Check if the API is reachable. No auth required.
FAQs
SDK for the Hanzi browser automation platform. Control a real Chrome browser programmatically.
We found that @hanzi-browse/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.