@proveanything/smartlinks 1.15.5 → 1.15.6
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/dist/docs/API_SUMMARY.md +1 -1
- package/dist/docs/appConfig.md +17 -8
- package/docs/API_SUMMARY.md +1 -1
- package/docs/appConfig.md +17 -8
- package/package.json +1 -1
package/dist/docs/API_SUMMARY.md
CHANGED
package/dist/docs/appConfig.md
CHANGED
|
@@ -220,20 +220,25 @@ Resolution rule (see `resolveFeature()` / `isFeatureEnabled()`, §6.0):
|
|
|
220
220
|
| `false` (explicit) | **off** | off |
|
|
221
221
|
| absent | **on** (enterprise default) | off (standard default) |
|
|
222
222
|
|
|
223
|
-
This is why reading `cfg.system.features.
|
|
223
|
+
This is why reading `cfg.system.features.customDomain` directly is wrong
|
|
224
224
|
for enterprise accounts — an absent key there does NOT mean disabled:
|
|
225
225
|
|
|
226
226
|
```ts
|
|
227
227
|
// ❌ WRONG for enterprise accounts — absent key silently reads as "off"
|
|
228
|
-
if (cfg.system.features.
|
|
228
|
+
if (cfg.system.features.customDomain) enableCustomDomainUI();
|
|
229
229
|
|
|
230
230
|
// ✅ CORRECT — applies the enterprise default
|
|
231
|
-
if (await appConfiguration.isFeatureEnabled(collectionId, '
|
|
231
|
+
if (await appConfiguration.isFeatureEnabled(collectionId, 'customDomain')) {
|
|
232
232
|
enableCustomDomainUI();
|
|
233
233
|
}
|
|
234
234
|
```
|
|
235
235
|
|
|
236
|
-
Feature flag naming:
|
|
236
|
+
Feature flag naming: camelCase, no `feature`/`is`/`has` prefix (e.g.
|
|
237
|
+
`customDomain`, not `feature_custom_domain` or `isCustomDomainEnabled`).
|
|
238
|
+
Flags belonging to the same topic/module may use a dotted grouping prefix,
|
|
239
|
+
e.g. `crm.broadcasts`, `crm.segments` — this is a plain string key in
|
|
240
|
+
`features`, not a nested object, so resolve it the same way:
|
|
241
|
+
`isFeatureEnabled(collectionId, 'crm.broadcasts')`.
|
|
237
242
|
|
|
238
243
|
Always resolve flags through `appConfiguration.isFeatureEnabled(collectionId, flag)`
|
|
239
244
|
/ `isFeatureEnabledSync()` (§6.0), or `appConfiguration.resolveFeature(cfg.system, flag)`
|
|
@@ -308,7 +313,7 @@ every subsequent call — so calling it once per component, or once per
|
|
|
308
313
|
render, doesn't cause repeat network requests.
|
|
309
314
|
|
|
310
315
|
```ts
|
|
311
|
-
if (await SL.appConfiguration.isFeatureEnabled(collectionId, '
|
|
316
|
+
if (await SL.appConfiguration.isFeatureEnabled(collectionId, 'customDomain')) {
|
|
312
317
|
enableCustomDomainUI();
|
|
313
318
|
}
|
|
314
319
|
```
|
|
@@ -321,11 +326,11 @@ cache once during app init and use the sync variant afterwards:
|
|
|
321
326
|
```ts
|
|
322
327
|
// Once, e.g. in a top-level effect or before first render:
|
|
323
328
|
useEffect(() => {
|
|
324
|
-
SL.appConfiguration.isFeatureEnabled(collectionId, '
|
|
329
|
+
SL.appConfiguration.isFeatureEnabled(collectionId, 'customDomain')
|
|
325
330
|
}, [collectionId]);
|
|
326
331
|
|
|
327
332
|
// Anywhere else, read synchronously — no await:
|
|
328
|
-
const enabled = SL.appConfiguration.isFeatureEnabledSync(collectionId, '
|
|
333
|
+
const enabled = SL.appConfiguration.isFeatureEnabledSync(collectionId, 'customDomain');
|
|
329
334
|
if (enabled === undefined) {
|
|
330
335
|
// not warmed yet this page load — treat as "not yet known", not "off"
|
|
331
336
|
}
|
|
@@ -341,7 +346,7 @@ to bypass it — e.g. immediately after your own code calls
|
|
|
341
346
|
`entitlements-reconcile` and the flags may have changed:
|
|
342
347
|
|
|
343
348
|
```ts
|
|
344
|
-
await SL.appConfiguration.isFeatureEnabled(collectionId, '
|
|
349
|
+
await SL.appConfiguration.isFeatureEnabled(collectionId, 'customDomain', { force: true });
|
|
345
350
|
```
|
|
346
351
|
|
|
347
352
|
### 6.1 Reading the raw config
|
|
@@ -481,3 +486,7 @@ CRM visibility), not just a capability flag.
|
|
|
481
486
|
`isFeatureEnabled()` like everything else. Reading `cfg.system.features[flag]`
|
|
482
487
|
directly is no longer correct for enterprise accounts — always resolve
|
|
483
488
|
through one of these three.
|
|
489
|
+
- **2026-07-19**: Corrected flag naming convention (§4.4): flags are
|
|
490
|
+
camelCase (e.g. `customDomain`), not snake_case, and may use a dotted
|
|
491
|
+
grouping prefix for a topic/module (e.g. `crm.broadcasts`). Updated all
|
|
492
|
+
examples in this doc accordingly.
|
package/docs/API_SUMMARY.md
CHANGED
package/docs/appConfig.md
CHANGED
|
@@ -220,20 +220,25 @@ Resolution rule (see `resolveFeature()` / `isFeatureEnabled()`, §6.0):
|
|
|
220
220
|
| `false` (explicit) | **off** | off |
|
|
221
221
|
| absent | **on** (enterprise default) | off (standard default) |
|
|
222
222
|
|
|
223
|
-
This is why reading `cfg.system.features.
|
|
223
|
+
This is why reading `cfg.system.features.customDomain` directly is wrong
|
|
224
224
|
for enterprise accounts — an absent key there does NOT mean disabled:
|
|
225
225
|
|
|
226
226
|
```ts
|
|
227
227
|
// ❌ WRONG for enterprise accounts — absent key silently reads as "off"
|
|
228
|
-
if (cfg.system.features.
|
|
228
|
+
if (cfg.system.features.customDomain) enableCustomDomainUI();
|
|
229
229
|
|
|
230
230
|
// ✅ CORRECT — applies the enterprise default
|
|
231
|
-
if (await appConfiguration.isFeatureEnabled(collectionId, '
|
|
231
|
+
if (await appConfiguration.isFeatureEnabled(collectionId, 'customDomain')) {
|
|
232
232
|
enableCustomDomainUI();
|
|
233
233
|
}
|
|
234
234
|
```
|
|
235
235
|
|
|
236
|
-
Feature flag naming:
|
|
236
|
+
Feature flag naming: camelCase, no `feature`/`is`/`has` prefix (e.g.
|
|
237
|
+
`customDomain`, not `feature_custom_domain` or `isCustomDomainEnabled`).
|
|
238
|
+
Flags belonging to the same topic/module may use a dotted grouping prefix,
|
|
239
|
+
e.g. `crm.broadcasts`, `crm.segments` — this is a plain string key in
|
|
240
|
+
`features`, not a nested object, so resolve it the same way:
|
|
241
|
+
`isFeatureEnabled(collectionId, 'crm.broadcasts')`.
|
|
237
242
|
|
|
238
243
|
Always resolve flags through `appConfiguration.isFeatureEnabled(collectionId, flag)`
|
|
239
244
|
/ `isFeatureEnabledSync()` (§6.0), or `appConfiguration.resolveFeature(cfg.system, flag)`
|
|
@@ -308,7 +313,7 @@ every subsequent call — so calling it once per component, or once per
|
|
|
308
313
|
render, doesn't cause repeat network requests.
|
|
309
314
|
|
|
310
315
|
```ts
|
|
311
|
-
if (await SL.appConfiguration.isFeatureEnabled(collectionId, '
|
|
316
|
+
if (await SL.appConfiguration.isFeatureEnabled(collectionId, 'customDomain')) {
|
|
312
317
|
enableCustomDomainUI();
|
|
313
318
|
}
|
|
314
319
|
```
|
|
@@ -321,11 +326,11 @@ cache once during app init and use the sync variant afterwards:
|
|
|
321
326
|
```ts
|
|
322
327
|
// Once, e.g. in a top-level effect or before first render:
|
|
323
328
|
useEffect(() => {
|
|
324
|
-
SL.appConfiguration.isFeatureEnabled(collectionId, '
|
|
329
|
+
SL.appConfiguration.isFeatureEnabled(collectionId, 'customDomain')
|
|
325
330
|
}, [collectionId]);
|
|
326
331
|
|
|
327
332
|
// Anywhere else, read synchronously — no await:
|
|
328
|
-
const enabled = SL.appConfiguration.isFeatureEnabledSync(collectionId, '
|
|
333
|
+
const enabled = SL.appConfiguration.isFeatureEnabledSync(collectionId, 'customDomain');
|
|
329
334
|
if (enabled === undefined) {
|
|
330
335
|
// not warmed yet this page load — treat as "not yet known", not "off"
|
|
331
336
|
}
|
|
@@ -341,7 +346,7 @@ to bypass it — e.g. immediately after your own code calls
|
|
|
341
346
|
`entitlements-reconcile` and the flags may have changed:
|
|
342
347
|
|
|
343
348
|
```ts
|
|
344
|
-
await SL.appConfiguration.isFeatureEnabled(collectionId, '
|
|
349
|
+
await SL.appConfiguration.isFeatureEnabled(collectionId, 'customDomain', { force: true });
|
|
345
350
|
```
|
|
346
351
|
|
|
347
352
|
### 6.1 Reading the raw config
|
|
@@ -481,3 +486,7 @@ CRM visibility), not just a capability flag.
|
|
|
481
486
|
`isFeatureEnabled()` like everything else. Reading `cfg.system.features[flag]`
|
|
482
487
|
directly is no longer correct for enterprise accounts — always resolve
|
|
483
488
|
through one of these three.
|
|
489
|
+
- **2026-07-19**: Corrected flag naming convention (§4.4): flags are
|
|
490
|
+
camelCase (e.g. `customDomain`), not snake_case, and may use a dotted
|
|
491
|
+
grouping prefix for a topic/module (e.g. `crm.broadcasts`). Updated all
|
|
492
|
+
examples in this doc accordingly.
|