as #
Returns a new EmbeddedSDK instance impersonating the provided user.
Arguments #
as (user: { _id: string }, options = { checkRights: false }): EmbeddedSDK;
Argument | Type | Description |
---|---|---|
user | { _id: string } | User object with at least the _id property |
options | object | Optional object with at least the checkRights property |
options:
Available since 2.10.0
Property | Type (default) | Description |
---|---|---|
checkRights | boolean | If true, will check if the impersonated user is allowed to execute any following actions |
Returns #
Returns a new impersonated EmbeddedSDK instance.
Usage #
await app.sdk.as(request.context.user).auth.getCurrentUser();
Edit this page on Github(opens new window)