Core
Framework v2.x
2

as #

Returns a new EmbeddedSDK instance impersonating the provided user.

Arguments #

as (user: { _id: string }, options = { checkRights: false }): EmbeddedSDK;

ArgumentTypeDescription
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
PropertyType (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();