Guides
Validate
This extension validation process helps catch configuration and code issues before you deploy. Addressing these issues upfront prevents runtime errors and marketplace submission rejections.
1. Manifest validation
Read packages/extension/public/manifest.json and verify:
- [ ] Valid JSON
- [ ]
nameis a non-empty string - [ ]
versionfollows semver (e.g., "1.0.0") - [ ]
targetsis a non-empty array of valid target strings (slot.header, slot.content, slot.footer, slot.footer-links) - [ ]
permissionscontains only valid permission strings (context:read, data:query, data:fetch, actions:toast, actions:invoke, messaging:send, identity:extend, events:identity, events:messaging, events:activity) - [ ]
allowedDomainsis an array (can be empty if data:fetch is not used) - [ ] If
data:fetchpermission is declared,allowedDomainsis not empty
2. Permission-to-usage matching
Scan all .tsx files in packages/extension/src/ for capability usage:
capabilities.data.queryordata.query→ needsdata:querypermissioncapabilities.data.fetchordata.fetch→ needsdata:fetchpermissioncapabilities.context.readoruseContextData→ needscontext:readpermissioncapabilities.actions.toast→ needsactions:toastpermissioncapabilities.actions.invoke→ needsactions:invokepermissionuseExtendIdentityorcapabilities.identity.extend→ needsidentity:extendpermission AND every custom key returned by the handler / passed toextend(patch)MUST be declared inmanifest.identityClaims(standard JWT claimsexternal_id/email/nameare exempt). Undeclared keys are dropped by the host filter with aconsole.warn.useIdentityEvent→ needsevents:identitypermission (also check manifesteventsarray has matching entries)useMessagingEvent→ needsevents:messagingpermission (also check manifesteventsarray has matching entries)useActivityEvent→ needsevents:activitypermission (also check manifesteventsarray has matching entries)
Report:
- Missing permissions: capabilities used in code but not declared in manifest
- Unused permissions: permissions declared in manifest but not used in code
- Undeclared identityClaims: keys returned from
useExtendIdentityor passed tocapabilities.identity.extendthat are not inmanifest.identityClaims(excluding the standard-claim exemption list)
3. Surface-to-target matching
- Each
.tsxfile with a<Surface id="...">should have a matching target in manifest.json - Each target in manifest.json should have a corresponding Surface component
4. Import validation
Verify that:
- [ ] UI components are imported via
ui.*namespace from@stackable-labs/sdk-extension-react - [ ] No direct imports of
document,window.location, or other browser globals - [ ] No modifications to
packages/preview/directory - [ ] Entry point is
src/index.tsxusingcreateExtension
5. Summary
Print a summary: total issues found, categorized by severity (error vs warning). Errors must be fixed before deploying. Warnings are recommendations.
Next: deploy
Once validation passes, build the production bundle, host it, and register the Bundle URL with Stackable. See the Deploy guide.