useTap returns.
Remarks
The host replacesauth, project, filters, theme, ui, params and
context with new objects rather than mutating them, so the useTap* hooks
can compare snapshots by reference. Read a value through its hook when the
component has to re-render on a change, and through tap when it does not.
Example
Extends
Properties
__portal
null until the shadow
root exists.
Inherited from
TapInternals.__portal
actions
run()
status is
pending while the owner has still to approve — the host draws the
approval card — and succeeded or failed when the owner has turned
asking off for this install, which no action-declaring extension can do
today. Rejects with a TapServerError when the host refuses the run.
Type Parameters
A
A extends string
Parameters
actionId
A
input
ActionInput<A>
Returns
Promise<TapActionRun>
auth
organizationId
scopes
token
user
user.id
user.role
can()
Parameters
scope
|"ui:render"
| "projects:read"
| "analytics:read"
| "store.metadata:read"
| "reviews:read"
| "crashes:read"
| "revenue:read"
| "metrics:write"
| "alerts:write"
| "insights:write"
| "ai:tools"
| "ai:actions"
| "store.metadata:write"
| "autopilot:trigger"
| "work:create"
| "work:sync"
| "storage:write"
| "messaging:send"
| "ai:skills"
Returns
boolean
context
data
query()
TAP_SCOPE_MISSING when the query’s scope is not granted.
Type Parameters
Q
Q extends TapQuery
Parameters
query
Q
Returns
Promise<TapResult<Q>>
subscribe()
Type Parameters
E
E extends
| "release.shipped"
| "metadata.changed"
| "keyword.set_changed"
| "screenshots.updated"
| "price.changed"
| "featuring.started"
| "score.changed"
| "incident.opened"
| "incident.resolved"
| "playbook.step_approved"
| "review.thread_opened"
| "review.thread_resolved"
| "approval.requested"
| "digest.sent"
| "install.created"
| "install.paused"
| "install.resumed"
| "install.revoked"
| "install.token_rotated"
| "scopes.changed"
| "settings.changed"
Parameters
event
E
handler
(payload) => void
Returns
() =>void
env
dev while the dev server serves the mount, else the install’s channel.
extension
id
installId
name
projectId
null when the extension is installed on the workspace, not a project.
filters
format
host
sdkMajors
version
locale
nav
openChat()
From <extension name>: line the owner can
edit or delete, cut to 2 KB, the same ceiling every vendor block the
assistant reads is held to.
Parameters
prompt
string
context?
Record<string, unknown>
Returns
void
openExternal()
Parameters
url
string
Returns
void
openSettings()
Returns
void
push()
Parameters
path
`/${string}`
Returns
void
setSearch()
null drops that parameter.
Parameters
params
Record<string, string | null>
Returns
void
params
pageId, path, and one key per sub-path segment.
project
apps
id
keywords
name
platforms
releases
server
state
get()
set replaces it, so
useTapState can use the value as a useSyncExternalStore snapshot.
Type Parameters
T
T
Parameters
key
string
Returns
T | undefined
set()
Type Parameters
T
T
Parameters
key
string
value
T
Returns
void
subscribe()
Parameters
key
string
handler
() =>void
Returns
() =>void
storage
telemetry
event()
Parameters
name
string
props?
Record<string, string | number | boolean>
Returns
void
theme
mode
timezone
ui
size
confirm()
Parameters
options
TapConfirmOptions
Returns
Promise<boolean>
copy()
Parameters
text
string
Returns
Promise<void>
download()
Parameters
blob
Blob
filename
string
Returns
void
expand()
Returns
void
openInChat()
insights:write; without it the host fills the composer with
a sentence describing the card instead, and the owner sends that.
Parameters
card
TapChatCard
Returns
void
toast()
neutral.
Parameters
message
string
tone?
TapToastTone
Returns
void
Methods
__subscribe()
useTap* hooks compare snapshots by reference. Returns an unsubscribe
function.
Parameters
key
TapChangeKey
listener
() =>void
Returns
() =>void
Inherited from
TapInternals.__subscribe
invalidate()
Parameters
name?
string
Returns
void