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:
- Register each component in a catalog: a stable id, a React render function, a props schema, its alternatives and a lock level.
- Provide a default document per screen.
- Create a
TweakLaneEnginewith your catalog and user id, and wrap your app inTweakLaneProvider. - Render each screen through the engine and start edit mode where your app wants it.
- 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.