TurboWarp-Sesame

A TurboWarp extension with sandboxed Direct mode and a localhost Relay mode for the Candy House Sesame Web API.

Bluetooth mode

  1. Load dist/turbowarp-sesame.js with Run extension without sandbox enabled, in Chrome or Edge on desktop or Android.
  2. Configure the keyholder URL and a device alias.
  3. Pair by scanning an owner or manager sharing QR code from the sesame app. Guest codes withhold half of the secret and cannot work over Bluetooth.
  4. Run the connect block straight after a click: the browser's device chooser needs a recent user gesture.

The device secret never reaches TurboWarp. It stays in the keyholder page on its own origin, which seals every frame before the extension writes it to the lock.

Relay setup

  1. Start @kubohiroya/keybroker on localhost.
  2. Load dist/turbowarp-sesame.js with Run extension without sandbox enabled. Browsers can deny localhost access from TurboWarp's sandbox iframe.
  3. Configure the Relay endpoint and device alias.
  4. Pair using the one-time code printed by the Relay.

Relay mode keeps provider credentials out of the SB3 file. Credentials written into Direct mode blocks are saved in the project and must not be shared.

Remote commands

Lock, unlock, and toggle requests are disabled in the default build. They can be enabled only by changing the build-time feature flag and rebuilding. After any accepted command, fetch the status again to verify the physical device.

Errors

API blocks return safe empty values when a request fails. Use last Sesame error to inspect the failure.

Source and full README

TurboWarp-Sesame: complete block reference

All 18 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.

configure Direct mode API key [API_KEY] UUID [UUID] secret key [SECRET_KEY]

Selects Direct mode and keeps the Candy House credentials in memory until they are cleared or the extension reloads.

Block type: COMMAND. Opcode: configure. Permanent link

Argument Type Default value Menu choices
API_KEY STRING api-key
UUID STRING 00000000-0000-0000-0000-000000000000
SECRET_KEY STRING 00000000000000000000000000000000

configure local Relay [ENDPOINT] device alias [DEVICE_ALIAS]

Selects Relay mode for a localhost keybroker without storing Candy House credentials in the project.

Block type: COMMAND. Opcode: configureRelay. Permanent link

Argument Type Default value Menu choices
ENDPOINT STRING http://127.0.0.1:8787
DEVICE_ALIAS STRING front-door

pair local Relay with one-time code [CODE]

Exchanges an eight-digit one-time code for a Relay token held only in extension memory.

Block type: COMMAND. Opcode: pairRelay. Permanent link

Argument Type Default value Menu choices
CODE STRING 00000000

configure Bluetooth keyholder [KEYHOLDER_URL] device alias [DEVICE_ALIAS]

Selects Bluetooth mode. The keyholder page holds the device secret on its own origin, so no credential is stored in the project.

Block type: COMMAND. Opcode: configureBluetooth. Permanent link

Argument Type Default value Menu choices
KEYHOLDER_URL STRING https://kubohiroya.github.io/turbowarp-sesame/keyholder/
DEVICE_ALIAS STRING front-door

open the Sesame keyholder

Opens the keyholder window and waits for it. Run this from its own click: opening a window and opening the Bluetooth chooser each need a fresh user gesture.

Block type: COMMAND. Opcode: openKeyholder. Permanent link

This block has no arguments.

pair Sesame by scanning its sharing QR code

Opens the keyholder so it can scan an owner or manager sharing QR code from the sesame app. Guest codes cannot work over Bluetooth.

Block type: COMMAND. Opcode: pairBluetooth. Permanent link

This block has no arguments.

connect to Sesame over Bluetooth

Opens the browser's device chooser and logs in. Run this straight after a click, because the chooser needs a recent user gesture.

Block type: COMMAND. Opcode: connectBluetooth. Permanent link

This block has no arguments.

Sesame Bluetooth connected?

Reports whether a Bluetooth session is logged in and usable.

Block type: BOOLEAN. Opcode: bluetoothConnected. Permanent link

This block has no arguments.

when the Sesame state changes

Runs when the lock reports that it moved. Only Bluetooth reports this; the cloud modes cannot.

Block type: HAT. Opcode: whenStateChanges. Permanent link

This block has no arguments.

clear Sesame connection

Removes Direct credentials or the local Relay session held by the running extension.

Block type: COMMAND. Opcode: clearCredentials. Permanent link

This block has no arguments.

Sesame connection ready?

Reports whether Direct credentials or a paired Relay session are currently held in memory.

Block type: BOOLEAN. Opcode: isConfigured. Permanent link

This block has no arguments.

local Relay paired?

Reports whether the current Relay connection has an in-memory session token.

Block type: BOOLEAN. Opcode: relayPaired. Permanent link

This block has no arguments.

Sesame connection mode

Reports direct, relay, or not configured.

Block type: REPORTER. Opcode: connectionMode. Permanent link

This block has no arguments.

Sesame status [FIELD]

Fetches one field from the current Sesame status.

Block type: REPORTER. Opcode: getStatusField. Permanent link

Argument Type Default value Menu choices
FIELD STRING CHSesame2Status
  • CHSesame2Status
  • batteryPercentage
  • batteryVoltage
  • position
  • timestamp
  • wm2State

Sesame history page [PAGE] length [LENGTH]

Fetches up to 50 history records as a JSON string.

Block type: REPORTER. Opcode: getHistory. Permanent link

Argument Type Default value Menu choices
PAGE NUMBER 0
LENGTH NUMBER 10

Sesame [COMMAND] with history [HISTORY]

Requests a lock, unlock, or toggle operation when remote commands are enabled in the build.

Block type: COMMAND. Opcode: sendCommand. Permanent link

Argument Type Default value Menu choices
COMMAND STRING lock
  • lock
  • unlock
  • toggle
HISTORY STRING TurboWarp

Sesame remote commands enabled?

Reports the build-time safety flag for remote lock commands.

Block type: BOOLEAN. Opcode: commandsEnabled. Permanent link

This block has no arguments.

last Sesame error

Reports the most recent configuration or API error without exposing credentials.

Block type: REPORTER. Opcode: lastError. Permanent link

This block has no arguments.

Repository guide and examples

Fixed input editing

With a compatible TurboWarp GUI, enable fixed-input forms to edit only standard literal fields. Numbers use complete finite JSON number tokens; menu fields use existing choices. Connected reporters and unavailable fields stay read-only and are never evaluated. Saving an unchanged form preserves exact existing raw values, including legacy spellings and unknown choices. Invalid drafts stay in the same editing session; cancel, project/target replacement, or block removal discards them. Disabling the GUI feature flag restores native field editing. This form does not run blocks, open network/audio/key/QR sessions, resolve names, or edit Schema arguments. History page and length keep existing truncation, clamping, and fallback behavior.