widget-web-component 1.5.0-rc.0-rc â 1.5.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 +9 -11
- package/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -133,33 +133,31 @@ Query string, hash and trailing slash are stripped from a valid URL.
|
|
|
133
133
|
|
|
134
134
|
## đ§ Environment config (`WidgetConfig`)
|
|
135
135
|
|
|
136
|
-
`runtimeEnv
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
HTML attributes.
|
|
136
|
+
`runtimeEnv` and `notificationsUrl` are **environment configuration** â they describe
|
|
137
|
+
*which* Belender backend the widget talks to. These values are passed at initialization
|
|
138
|
+
time via `initBelenderComponent(config)`, not as HTML attributes.
|
|
140
139
|
|
|
141
140
|
```js
|
|
142
141
|
initBelenderComponent({
|
|
143
142
|
runtimeEnv: 'qa',
|
|
144
|
-
organization: 'belender',
|
|
145
143
|
notificationsUrl: 'wss://ws.custom-funder.com',
|
|
146
|
-
scraperMock: true
|
|
147
144
|
}).then((BelenderWebComponent) => {
|
|
148
145
|
customElements.define('belender-web-component', BelenderWebComponent);
|
|
149
146
|
});
|
|
150
147
|
```
|
|
151
148
|
|
|
152
149
|
**When omitted**, each field falls back to automatic derivation from the hostname of
|
|
153
|
-
`api-url` (e.g. `.qa.` â `qa`, `api.` prefix â notifications URL
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
`api-url` (e.g. `.qa.` â `qa`, `api.` prefix â notifications URL). This means you only
|
|
151
|
+
need to pass config when `api-url` points to a **custom domain** outside Belender's
|
|
152
|
+
naming conventions.
|
|
156
153
|
|
|
157
154
|
**Fields are independent** â you can set any subset. Unset values still fall back to
|
|
158
155
|
the automatic derivation.
|
|
159
156
|
|
|
157
|
+
> âšī¸ `organization` and `scraperMock` are always derived automatically from `api-url`
|
|
158
|
+
> and are not configurable by the host.
|
|
159
|
+
|
|
160
160
|
| Field | Type | Valid values | Derived from `api-url` when omitted |
|
|
161
161
|
|---|---|---|---|
|
|
162
162
|
| `runtimeEnv` | string | `qa`, `dev`, `pro` | `.qa.` in hostname â `qa`, `.dev.` â `dev`, otherwise â `pro` |
|
|
163
|
-
| `organization` | string | `belender`, `opendata` | `opendata` in hostname â `opendata`, otherwise â `belender` |
|
|
164
163
|
| `notificationsUrl` | string | Any `ws://` or `wss://` URL | `api.` prefix replaced with `notifications.` |
|
|
165
|
-
| `scraperMock` | boolean | `true`, `false` | `belender`+`qa` or `opendata`+`dev` â `true`, otherwise â `false` |
|