One build, fourteen apps: see what users made of Memory Tin

Documentation

Quickstart: Web

Documentation menu

Requirements: React 18.2 or newer (react and react-dom are peer dependencies). The package is an ES module with TypeScript types.

1. Install

npm install @tweaklane/web

2. Same model as iOS

The web SDK follows the same steps as the iOS quickstart, with React components in place of SwiftUI views:

  1. Register each component in a catalog: a stable id, a React render function, a props schema, its alternatives and a lock level.
  2. Provide a default document per screen.
  3. Create a TweakLaneEngine with your catalog and user id, and wrap your app in TweakLaneProvider.
  4. Render each screen through the engine and start edit mode where your app wants it.
  5. Connect sync with your public SDK key, your {TWEAKLANE_URL} and a token provider that asks your backend for a user token.

The layout documents, catalog manifest, validation rules and issue codes are identical on every platform: the web SDK runs the server's validators and the same shared fixtures.

The package README on npm carries the complete TypeScript API.

3. Tokens in the browser

Never put the secret server key in front-end code. Your web app asks your own backend for a user token, the same way the mobile apps do. See Connect your backend.