setUserId

Callable

  • setUserId(userId: string ) : Promise < Product >
  • Set user unique identifier and move user files to the user folder. See the Working with User Data topic for details.

    example
    editor.getProduct()
        .then(function (product) {
            // Get the current user id.
            console.log("Current user: " + product.userId);
            // Change userId and move the user's data.
            product.setUserId("JohnDoe")
                .then(function (product) {
                    // Check new user id.
                    console.log("New user: " + product.userId);
                });
        })
        .catch(function (error) {
            console.error("Switching the userId failed with exception: ", error);
        });
    

    Parameters

    • userId: string

      User identifier.

    Returns Promise < Product >