Skip to content

API reference

The complete public surface of grist-widget-sdk. Anything not listed here is internal and may change between minor versions.

Entry points

Import pathUse for
grist-widget-sdkPrimary surface — components, hooks, helpers, types.
grist-widget-sdk/advancedLower-level hooks (useGristReady, useGristRowsFromTable, …).
grist-widget-sdk/emulatorEmulator core for storybook/playgrounds.
grist-widget-sdk/emulator/testingrenderWithGrist, presets, test-only helpers.

Components

SymbolPurposeReference
GristWidgetProviderApp-root wiring: grist.ready, contexts, subscriptions./api/provider-boundary
GristBoundaryBooting / unavailable / error UI chrome./api/provider-boundary

Primary hook

SymbolPurposeReference
useGrist<TRow, TMapped>()Default surface — selection, writes, options, REST, theme./api/use-grist

Slice hooks

Performance-oriented subscriptions to one part of the state.

SymbolReference
useGristSelection<TRow, TMapped>()/api/slice-hooks
useGristWrites()/api/slice-hooks
useGristStatus()/api/slice-hooks
useGristTheme()/api/slice-hooks

Schema

SymbolReference
useGristSchema(options?)/api/use-grist-schema

Helpers

Standalone utilities that don't require the React context.

SymbolReference
Value codec/api/helpers
Safe parsing/api/helpers
Action builders/api/helpers
Replica document/api/helpers
Attachments/api/helpers
REST/api/helpers
Column mapping/api/helpers
Alerts/api/helpers

Types

A single page listing every exported type, with brief inline doc. See /api/types.

Handshake module

Opt-in FSM view of the widget ↔ Grist handshake (snapshot + capabilities

  • heartbeat). The default useGrist().status is a projection over this same machine.
SymbolReference
GristHandshakeProvider, useGristHandshakeContext, useGristHandshakeContextOptional/api/handshake
useGristHandshake, useGristCapabilities/api/handshake
GristWidgetSnapshot, GristCapabilities, GristLifecycle, GristLink, GristSync, GristConfig, GristAuthz/api/handshake

Advanced hooks

Opt-in lower-level hooks for use cases the default surface doesn't cover.

SymbolReference
useGristReady/api/advanced
useGristAvailability/api/advanced
useGristRowsFromTable/api/advanced
useGristWidgetOptions/api/advanced

Emulator & testing

SymbolReference
createGristEmulator, mountGristEmulator/api/emulator
renderWithGrist, presets/api/emulator
parseDocument, parseRowFor, parseRowsFor/api/emulator

Released under the ISC License.