Skip to main content

window.presskey API

PressKey exposes a typed request interface on the window object:

Nonce Challenge Flow

Every write action follows this path:

postMessage Event Matrix

PressKey also communicates via window.postMessage. All messages follow the shape { type: string, payload: object }.

Inbound (App to PressKey)

PRESSKEY_ALLOW_SITERequest site permission to interact with PressKey
PRESSKEY_REQUESTRequest a signed action (vote, publish, role purchase, etc.)
PRESSKEY_FORWARD_RPCForward an RPC call through PressKey’s provider
PRESSKEY_RPC_REQUESTDirect RPC call via PressKey’s injected EIP-1193 provider
PRESSKEY_OPEN_BOND_APPROVALOpen PressKey UI for bond deposit or dissolution approval
PRESSKEY_OPEN_CAPSULE_APPROVALOpen PressKey UI for Capsule publish approval (30 PRESS fee)
PRESSKEY_OPEN_SEND_APPROVALOpen PressKey UI for a PRESS token send approval
PRESSKEY_GET_PENDING_APPROVALQuery the current queue of pending approvals in PressKey
PRESSKEY_APPROVE_PENDING_APPROVALApprove a specific pending action in PressKey
PRESSKEY_REJECT_PENDING_APPROVALReject a specific pending action in PressKey
PRESSKEY_REFRESH_TX_STATUSRequest a refresh of the status for a pending transaction
PRESSKEY_GET_LATEST_TXFetch the most recent transaction from PressKey history

Outbound (PressKey to App)

PRESSKEY_EXTENSIONExtension has loaded and is ready. Payload includes address, roles, balance, and network.
PRESSKEY_PAGEPage-level PressKey state update (navigation, context change)
PRESSGeneral PRESS token event: balance change, transfer confirmed
FETCH_FAILEDA PressKey-proxied fetch request failed. Check payload for error details.
OFFCHAIN_FAULTAn off-chain action failed (Bridge error, API timeout, session invalid)

Integration Example

Standard React state for PressKey-driven modals in portal apps:

WordPress Security Boundary

WordPress never handles keys. The signing boundary is strictly:
WordPress sees a web API. This is a hard architectural rule, not a best practice.