TypeScript SDK reference

The noclick package, generated from its own source: every class, method and error.

npm install noclick

Version 0.2.6. New here? Start with the guide.

NoClick Platform SDK: users, sessions, connections, tools, humans, agents, channels, inboxes, phone numbers, sandboxes, machines, browsers and cards; databases, buckets, repos, apps and domains, each in a region; plus the activity they leave (operations, events, tool calls, API requests, usage).

import { Connection, User, asUser } from "noclick";

const user = User.fromId("user_42", { createIfMissing: true });
await asUser(user, async () => {
  const gmail = await Connection.fromName("gmail", { integration: "gmail", createIfMissing: true }).hydrate();
  console.log(gmail.connectUrl);
});

Configuration

NameDescription
NoClick

Connection settings for the platform API.

configure

Replace the default client, e.g. noclick.configure(api_key="nk_live_...").

defaultClient

Get the client used when no client= is given, built from the environment on first use.

Page

One page of a listing; pass next_cursor back as cursor for the next (None = the last page).

Key

A platform secret key of your account's: its id, name, scopes, monthly cap, expiry, the user it's pinned to (user_id) and the key that made it (minted_by; None for one the owner made).

CliLogin

A device sign-in, what a command line does to get a key without anyone pasting one (start, poll), and one waiting, as its approver reads it: the user_code its terminal shows, the client and hostname that started it, the address it came from (ip), the name of the key it gets (key_name), its status (pending, approved or denied) and when it lapses.

regions

Every region, or those that place kind ("sandbox", "agent", "bucket", "database", "project", "machine", "browser", "dict" or "queue"; any other raises noclick.InvalidRequest naming those that are placed by region).

Region

A place NoClick runs resources and keeps their data; region= takes its name.

Your users

NameDescription
User

One of your users, a person or a company, known by your own id for it.

Spending

Whether a user can spend right now, as user.spending reads it.

asUser

Act for user inside the block: a User, your id for the user, or None for the account itself.

Session

A token pinned to one user with a subset of the minting key's scopes.

Brand

One per account; rendered on /h/ pages and human emails.

Their accounts

NameDescription
Connection

A named connection to an account on another service.

run

Run one operation by its ref, "name.operation", as tools= names it.

ConnectLink

A connect page URL that is also the operation tracking it.

IntegrationInfo

A service NoClick can operate, such as gmail, or a model provider an agent thinks with, such as anthropic: one of Connection.integrations().

IntegrationOperation

One operation of a connection's integration, with the JSON schema of the parameters connection.run takes for it.

IntegrationEvent

An app event a connection's integration can deliver to an agent's noclick.OnEvent trigger, a channel's subscription or an app's: its name (channel_message, contact_created), what it means, and filters, the keyword arguments that narrow it, each with what it matches (one marked Required. must be given).

Hosted agents

NameDescription
Agent

A hosted agent.

HarnessInfo

What can run an agent: one of Agent.harnesses().

ModelUsage

What an agent's model calls on your own key or plan (its model_connection) used: tokens in (cached_tokens of them read from the provider's cache), tokens out, and what they come to in US dollars at the provider's list price.

AgentGrant

A connection the agent's user gave it at run time (it asked with its request_connection tool, within can_request).

Cron

A schedule: a five-field cron expression (minute, hour, day of month, month, day of week: numbers, *, ranges, steps, lists and month or day names) read in a timezone, so "0 9 * * 1-5" with tz="America/New_York" means 9am New York time on weekdays, daylight saving included.

OnWebhook

A URL that wakes the agent: each POST to it is a turn, its body the message (a JSON body is passed as JSON).

OnEvent

An app event from one of the agent's connections, such as a Slack message or a new HubSpot contact.

OnPlatformEvent

One of NoClick's own events (the types noclick.Event.types() lists, as your webhooks receive them): an operation failing, a connection breaking, a channel halting, a workflow's run failing, an agent built in the app asking for you, a payment going through.

OnQueue

Each message on a queue becomes a turn: the agent reads message (its standing instructions, if any) and then the message's JSON body.

AgentTrigger

One thing that wakes an agent, as agent.triggers() reads it.

AgentMemory

agent.memory: named notes the agent keeps across conversations.

Memory

Named notes any agent of its scope can attach: the account's (every user's agents may read them) or one user's.

Skill

An Agent Skills folder of the account's (every user's agents may use it) or one user's, versioned.

AgentWorkspace

The files an agent works on: what it writes with its shell or its tools, and what you put there for it.

ShareLink

An agent's public chat page, or a workflow's agent step's (Step.share: workflow_id and step_id name it, agent_id is None).

Wakeup

A turn an agent will take later, in one of its conversations: at a time, when an operation settles, on a NoClick event, or at each time of a schedule (agent.wake, or its own wake_me tool).

Job

Work one agent gave another: a spawned child's task (kind agent.task), or a message a coordinator sent with its agents tools (kind agent.message), whose only update is done.

Before

An update the parent requires before its child makes a tool call: Before with tool patterns written as policy writes them ("gmail.send_email_message", "stripe.*", "code").

Every

An update the parent requires at least this often while its child works: Every with an interval in seconds (or a timedelta), 60 seconds or more.

Agents

The agents capability, for an agent's tools: the same as the string "agents", narrowed with Agents.only(...).

Platform

NoClick itself, for an agent's tools: the same as the string "noclick", narrowed with Platform.only(...).

Attachment

A file on a message, kept as an account file at url.

Terminal

A coding agent's conversation as its harness's own terminal: state is agent (the agent has it), taking_over (its turn in flight finishes first), person (taken over) or handing_back.

AgentMove

A move from a laptop: waiting for its code to be redeemed, moving while what the agent carries arrives (arrived), finishing while the agent is made (steps), then done with agent_id and conversation; failed (finish again), canceled or expired.

Channel

A conversation between members.

Subscription

Events a channel, a whole noclick.Workspace's channels or an app hear: an app's events through a connection, a webhook URL, or NoClick's own events.

Workspace

A home for channels and their members, like a workspace in a team chat: a company, a client or a team, with its people, its agents and its rooms.

A2AMember

A remote agent reached over A2A.

Tools for your own LLM

NameDescription
Toolkit

A set of tools for your LLM.

ToolResult

The outcome of one tool call.

McpServer

Your tools at one URL, for Claude, ChatGPT, Cursor or any MCP client.

AI

Models paid from your NoClick balance, for code that isn't an agent: chat, embeddings, images, videos and transcription; and your agents as agent:<name> models.

People in the loop

NameDescription
Human

A person to reach.

HumanOperations

Some of a person's tools for an agent (human.only(...)), for tools=.

HumanRequest

A request to a person; also the operation that finishes when they answer.

Approval

A call held for your account's owner's yes, as they see it on its page.

Policy

The account's policy, or one user's (user_id).

ConnectedApp

One connection, revoked or not: the client (client_name, and client_id, noclick: for one NoClick makes itself), the capability groups it holds (read, build, deploy, spend, delete), its monthly cap and the amount under which a purchase it makes goes through unasked (None: none of its own, and it asks before every one), what it spent this month, and the user it acts for (None: your account).

Acting in the world

NameDescription
Inbox

An email address that receives mail.

PhoneNumber

A number you own, however you got it.

Browser

A running browser.

BrowserProfile

Saved sign-ins for one person.

BrowserLogin

A live-browser link where a person signs in to a site, and the operation that finishes once they have: wait() returns the SiteLogin.

Cardinvite-only beta

A virtual card with a spending limit.

Sandbox

A running sandbox.

Machine

An always-on computer of a fixed size in one region, billed a flat monthly price.

compute

Your machines (any status, with the conversations on each), every agent's sandbox up now and every live Sandbox, each with its price an hour.

Build and host

NameDescription
deploy

Deploy source as a new app of yours: a public git repository's https URL, on any host (copied into a new repo of yours, the one branch it deploys), public work on NoClick by its https address ("https://pilot-hub.noclick.site": a copy of the code its owner made public), or one of your own repos (a Repo, its id or its name, deployed as it is).

Project

An app: a repo deployed to a URL.

Deployment

One build of a project at one commit.

Schedule

A project's cron job: NoClick POSTs path on the app on every tick of cron (read in tz).

ProjectEmail

app.email: transactional email from the app's own address (receipts, booking confirmations), rate-capped and charged per recipient; a high bounce or complaint rate pauses sending.

ProjectPayments

app.payments: take payments in the app without a payments account of your own.

ProjectSignIn

app.sign_in: accounts for the app's own users.

ProjectAI

app.ai: noclick.AI acting as the app, from the app's own code (Project.current()).

ProjectLive

app.live: edit the app in a live session.

Repo

A git repository NoClick hosts.

Domain

A domain you bought through NoClick, transferred in, or connected from elsewhere, and what it serves.

DomainPurchase

A domain bought or renewed: the operation Domain.buy and domain.renew return.

Workflow

A workflow built in the NoClick app: its trigger, steps and outputs.

estimate

What items would cost a month, before you make any of them.

Estimate

What the items would cost a month: a usage-based estimate, priced for your account's plan.

Data

NameDescription
Database

A SQL database: SQLite (engine="sqlite", the default, cheap while idle) or Postgres.

Bucket

A bucket of files by key.

Volume

A persistent filesystem: files by path, in folders, that outlive the sandbox or agent turn that wrote them.

Dict

A key-value store: string keys, JSON values, optional expiry per key.

Queue

A durable queue of JSON messages, delivered at least once.

Secret

Named values, such as API keys, that the code you run reads from its environment: a sandbox's commands, an agent's shell, an app.

In production

NameDescription
Operation

A long-running piece of work.

TrashItem

Something deleted, restorable until purge_after.

Event

Something that happened: an operation finished, a person answered, a domain went live.

Webhook

An endpoint on your server that receives events, signed with its secret.

watch

Follow your objects' changes until you stop reading.

ToolCall

One recorded tool call.

ApiRequest

One logged request.

usage

Spend for period ("month"), optionally split group_by "user", "key", "agent", "project" (each app), "person" (who each charge was for: the person whose message, click or key started the work; the account's owner for work nobody else started) or "workstream" (the line of work it belongs to, as the agent that started it named it), and narrowed to one agent (an Agent or its id).

Usage

What the account (or the current user) spent in period.

Notifications

Which kinds of email alert NoClick sends your account's owner: categories maps each kind (run_failure, credits, spend_cap, digest, ...) to whether it's on.

Popups

Which of the NoClick app's popups and banners your account's owner sees: popups maps each one (run_results, the outputs shown after a workflow runs; invite_banner, the nudge to share a workflow's live invite link; publish_banner, the nudge to publish an interface) to whether it shows.

AccountPhones

The numbers linked to your account.

AccountPush

The browsers that show the signed-in person NoClick's notifications: a DM or @mention of them in a space, a question or approval that needs them, and work that finished while they weren't watching.

BuilderSkill

A skill NoClick's builder loads: a description the builder reads to decide whether it needs it, plus text and, optionally, a workflow to follow.

ExportBundle

What an export produced: a zip at url (a link that works until expires_at, 7 days) of size_bytes, what's in it, and remaining_dependencies, what keeps needing NoClick while the account exists (the agent runtime, channels, people's pending asks, app hosting, connections).

feedback

Tell the NoClick team something: a bug, an idea, or anything (general).

Errors

NameDescription
NoClickError

Base class for every NoClick platform error.

NeedsConnection

The connection has no account connected yet; send the person connect_url.

CredentialDisconnected

The connection's account was revoked or stopped working; send the person connect_url to reconnect it (same name).

ApprovalRequired

Policy wants a person to approve this call first.

SpendCapExceeded

A monthly spend cap (scope: key, user, agent, ...) is used up.

SpendingPaused

You paused this user's spending (user.pause_spending()), so nothing that costs money runs for them until user.resume_spending().

Conflict

It already exists (existing_id names it), or another call holds it, like a conversation mid-turn.

WebhookSignatureError

A webhook delivery's NoClick-Signature doesn't match its body, or its timestamp is too old.

Every object

Live API objects: User, Agent, Operation and the rest.

An object can exist before the server has been asked about it (User.from_id(...), Agent.from_name(...), Operation.from_id(...)). It hydrates on first need: a method call, or a property the local hints can't answer. hydrate() does it explicitly. An object you got while acting for a user keeps acting for that user.

Attributes
isHydratedboolean

Whether the server's view has been loaded.

rawJsonObject

The server's JSON for this object (throws until hydrated).

fromJSONstatic

static fromJSON(raw: JsonObject, options?: CallOptions): T

The object as its toJSON() gave it (kept in a browser's storage, say), without reading it: what it shows is as of then, and refresh() reads it again.

const domain = Domain.fromJSON(kept, { client });
Parameters
rawJsonObjectrequired
options.clientNoClick

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

options.userUserOption

undefined = the ambient user (asUser), null = the account itself.

(defaults to the current user)
Returns

An object of this class, holding raw. It sends nothing.

Types
type JsonObject = { [key: string]: unknown };

/** `undefined` = the ambient user (from `asUser`), `null` = the account itself. */
type UserOption = UserRef | null | undefined;

/** A `User` or your own id for the user. */
type UserRef = string | UserLike;

/** Anything that can name a user lazily (a `User`). */
interface UserLike {
  _userId(): Promise<string>;
}

hydrate

hydrate(): Promise<this>

Load the object from the server if it hasn't been yet.

Returns

This object, loaded. It sends nothing if it already was.

refresh

refresh(): Promise<this>

Re-fetch the object's current state.

Returns

This object, with the server's current fields.