webim-adapter 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/build/webim-adapter.js +983 -544
- package/build/webim-embed.js +2 -2
- package/build/webim-ssr.js +994 -557
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# webim-adapter
|
|
2
2
|
|
|
3
|
-
Render pages built with the
|
|
3
|
+
Render pages built with the Web-IM page builder inside any React app.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install webim-adapter
|
|
@@ -10,7 +10,7 @@ npm install webim-adapter
|
|
|
10
10
|
import { WebimPage } from 'webim-adapter';
|
|
11
11
|
|
|
12
12
|
<WebimPage
|
|
13
|
-
apiUrl="https://api.example.com/api" //
|
|
13
|
+
apiUrl="https://api.example.com/api" // Web-IM gateway base
|
|
14
14
|
tenant="acme" // tenant slug (X-Tenant header)
|
|
15
15
|
slug="landing" // published page slug
|
|
16
16
|
locale="tr" // optional content locale
|
|
@@ -24,7 +24,7 @@ import { WebimPage } from 'webim-adapter';
|
|
|
24
24
|
Only published pages render — drafts 404. The component fetches the page
|
|
25
25
|
(`GET /render/:slug`) and the tenant's public theme/component libraries
|
|
26
26
|
(`GET /settings/public`) in parallel, then renders the block tree with the
|
|
27
|
-
same renderer the builder uses. Embedded
|
|
27
|
+
same renderer the builder uses. Embedded Web-IM forms submit to the public
|
|
28
28
|
forms engine automatically.
|
|
29
29
|
|
|
30
30
|
## SSR / prefetching
|
|
@@ -65,7 +65,7 @@ added after load: `window.WebimEmbed.scan()`, or
|
|
|
65
65
|
|
|
66
66
|
## Server-rendered HTML (zero-JS consumers / SEO)
|
|
67
67
|
|
|
68
|
-
The
|
|
68
|
+
The Web-IM gateway serves a complete HTML document per published page:
|
|
69
69
|
|
|
70
70
|
```
|
|
71
71
|
GET /api/render/:slug/html?tenant=acme&locale=tr&mode=light
|
|
@@ -127,4 +127,4 @@ a token and copies the ready-to-share HTML URL.
|
|
|
127
127
|
- A page's custom code (`meta.custom.js` and Embed blocks) executes in the
|
|
128
128
|
host page — embed content only from tenants you trust, exactly like a tag
|
|
129
129
|
manager snippet.
|
|
130
|
-
- The
|
|
130
|
+
- The Web-IM gateway must allow CORS from the host origin.
|