Skip to main content

How do I enable User-Saved Blocks in Unlayer?

How do I enable User-Saved Blocks in Unlayer?

Khizar Tanveer avatar
Written by Khizar Tanveer
Updated over 3 months ago

Enabling the User-Saved Blocks feature in Unlayer allows users to save their customized blocks directly within the editor. This can significantly enhance the flexibility and usability of the Unlayer editor for your end-users. Follow the instructions below to implement this functionality.

Prerequisites

To enable User-Saved Blocks, it is essential to implement End-User Identification. This involves passing a user object in the unlayer.init() configuration. The user object ensures that saved blocks are specific to individual users and securely linked to their accounts.

Implementation Steps

  1. Use the unlayer.init() method to configure the Unlayer editor in your application.

  2. Include the user object in the configuration to allow for end-user-specific operations, as shown in the example below:
    ​
    unlayer.init({
    id: 'editor',
    displayMode: 'email',
    projectId: 0, //Enter your projectID here.
    user:{
    id:1
    },

Additional References

For further information, refer to the following official resources:

By following these steps, the User-Saved Blocks feature can be successfully enabled in your Unlayer editor configuration.

Did this answer your question?