Widgets
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- createToken() : WidgetSessionTokenResponse
- Generate a widget token
Properties
$client read-only
private
HttpClient
$client
Methods
__construct()
public
__construct(HttpClient $client) : mixed
Parameters
- $client : HttpClient
createToken()
Generate a widget token
public
createToken([string|null $organizationId = null ][, string|null $userId = null ][, array<string|int, WidgetSessionTokenScopes>|null $scopes = null ][, RequestOptions|null $options = null ]) : WidgetSessionTokenResponse
Generate a widget token for a user, optionally scoped to an organization. When an organization is specified, org-scoped widgets are enabled; omitting it issues a user-only token for widgets like UserProfile and UserSecurity.
Parameters
- $organizationId : string|null = null
-
The ID of the organization to scope the widget session to. Required when scopes are provided. Optional when issuing a token for user-only widgets (e.g.
UserProfile,UserSecurity) that do not require organization context. - $userId : string|null = null
-
The ID of the user to issue the widget session token for.
- $scopes : array<string|int, WidgetSessionTokenScopes>|null = null
-
The scopes to grant the widget session.
- $options : RequestOptions|null = null