Skip to content

Context

Everything an extension’s callbacks get, capability-gated by the manifest’s permissions.

extensionId: string


log: Logger


oauth: OAuth

Sign-in to the services your manifest declares in oauth, run by the app.


preferences: Preferences


secrets: Secrets

Keychain-backed; use for tokens, never storage (a plain file).


storage: Storage


trigger: Trigger

emit(blip): void

Emits a full snapshot for one blip. Call once per changed item, not a diff.

Parameter Type
blip BlipInput

void


end(key, options?): void

Marks a blip finished; surfaces show the final state, then dismiss it.

Parameter Type
key string
options? { dismissAfter?: number; state?: "success" | "failure"; }
options.dismissAfter? number
options.state? "success" | "failure"

void


exec(file, args?, options?): Promise<ExecResult>

Runs an executable listed in permissions.exec. Rejects if it isn’t.

Parameter Type
file string
args? string[]
options? { cwd?: string; timeoutMs?: number; }
options.cwd? string
options.timeoutMs? number

Promise<ExecResult>


notify(title, body?): Promise<void>

A line under the notch for a few seconds, for the result of something the user just did.

Parameter Type
title string
body? string

Promise<void>


openURL(url): Promise<void>

Opens a URL with the user’s default handler.

Parameter Type
url string

Promise<void>


remove(key): void

Removes a blip immediately, with no final-state flourish.

Parameter Type
key string

void


requestFolderAccess(path): Promise<void>

Asks the person to let Blipbar read a folder that macOS keeps from other apps (another app’s data, like the Stocks app’s watchlist, which is refused with no prompt of its own): macOS’s Open dialog, already at path, where one press of Allow grants that folder and nothing else, remembered from then on. The folder must be one of your permissions.files. It resolves once the dialog is up; when they allow it, update() runs again.

Parameter Type
path string

Promise<void>


respond(replyId, body, status?): void

Completes a webhook request that’s being held on event.replyId.

Parameter Type
replyId string
body unknown
status? number

void


setPreference(name, value): Promise<void>

Changes one of your own options (never a password), as if it were changed in Settings: it’s saved, and update() runs again with it. For a button that sets something up in one press (“Keep watching this repository”). undefined clears it.

Parameter Type
name string
value string | number | boolean | undefined

Promise<void>


workingHours(): Promise<WorkingHours | undefined>

The person’s working hours, or undefined when they haven’t set any (every hour is one).

Promise<WorkingHours | undefined>