Copyl's architecture allows for seamless integration of custom-built components, offering a strategic advantage for businesses looking to tailor their digital solutions. This feature empowers developers to create bespoke functionalities that can be easily incorporated into the Copyl ecosystem.
https://c.copyl.com/assets/components/copyl.css
.app-widget-wrapper
, pass parameters via widgetConfig
.Your Web Component will be injected with these parameters:
jwt
: the token from Copyl Sign-inuserId
: the unique user id from Copylemail
: the user’s verified emailroles
: a list of the roles the user has in CopylenterpriseId
: the unique tenant id the company has in Copyltheme
: the user’s selected ui themelicenses
: the user’s licenses in CopylinjectMetaInfo() {
const meta = {
jwt: this.getAttribute('**jwt**'),
userId: this.getAttribute('**user-id**'),
email: this.getAttribute('**email**'),
roles: this.getAttribute('**roles**'),
enterpriseId: this.getAttribute('**enterprise-id**'),
theme: this.getAttribute('**theme**'),
licenses: this.getAttribute('licenses'),
};
console.log('Received parameters:', meta);
}
If you host the widget externally:
https://app.copyl.com
Accessing user context in a Widget / Web Component
Copyl Styling Guide for Web Components
These files and rule shows a working example of one widget/web component raising an event that another widget get a notification of.
[{
"trigger": "DeviceSelected",
"targetWidgetId": "32bf45ec-b58e-4322-8051-69d86b2c7073",
"action": "selectDevice",
"args": ["*"]
}]
Just paste and change the targetWidgetId
to your new Id and add the rule to the Page Properties Script.
Requirement | Status |
---|---|
Shadow DOM open | ✅ Required |
Remote CSS from Copyl | ✅ Required |
Supports JWT/userId/email | ✅ Required |
Uses Bootstrap-compatible classes or MUI themes | ✅ Recommended |
Exposes parts (::part ) |
⚠ Optional |
Secure, no sensitive leaks | ✅ Required |
Uses HTTPS with CORS | ✅ Required |
Contact Copyl Developer Support for: