Sharing in Widgets
Dashboards (excluding Legacy Dashboards) have the concept of Ownership. When a user creates a dashboard, you must pass a clientId
to identify the user and an orgId
to identify the organization the user belongs to. If this user wants to share the dashboard, they can share it with their organization (defined by the user's orgId
) or pass the orgs
object to share it with specific users or roles within the same organization.
Sharing must occur within the same organization. The user who wants to share the dashboard must be identified with a clientId
and orgId
.
Sharing a Dashboard with a user must include:
orgId
orgs.users[]
with the user'sclientId
and validemail
.
Any widgets that need to access dashboard information, such as Automation (Flows), must also pass the clientId
and orgId
. This ensures that only dashboards the clientId
has access to are listed, as well as charts inside them when attached to Send Email actions.
When embedding Dashboards created within Composer:
- Set
orgId: "org:0"
. - Then pass the desired
clientId
to enable Dashboard personalization. - These options will function just like in Composer, even displaying the Composer users for sharing.
Example:
"orgs": [
{
"orgId": "org:0",
"users": [
{
"clientId": "john_smith",
"email": "john_smith@qrvey.com"
}
]
}
]
When accessing a dashboard that has been shared with a role, assign the role to the user so they can access the dashboard.
{ // the dashboard config object
"appId": "XVDq3Xr",
"userId": "Sk7HuNH",
"clientId": "jane_doe",
"expiresIn": "1y",
"orgId": "org:0",
"roles": ["QA"]
}
Include roles in orgs.orgRoles[]
to share the dashboard with specific roles:
"orgs": [
{
"orgId": "org:0",
"orgRoles": ["QA"]
}
]
For JWT/Config-Based Sharing in Embedded Dashboards, embed the dashboard with the orgs[]
object in the QV Token or config object. This enables the UI to display the list of users and roles for sharing.
{
"appId": "XVDq3Xr",
"userId": "Sk7HuNH",
"clientId": "jane_doe",
"expiresIn": "1y",
"orgId": "org:0",
"roles": ["QA"],
"orgs": [
{
"orgId": "1",
"orgRoles": [
"QA"
],
"users": [
{
"clientId": "john_smith",
"email": "john_smith@qrvey.com"
}
]
}
]
}