Home App Docs Blog Github

Can you create password protected pages in Builder?

Yes, but it depends on how “secure” you need your password protected page to be. By default, content management platforms like Builder take the content you enter and make it retrievable via API so that it can be displayed on your site or app. This means that if you publish a page in Builder, that content is now available publicly via API, so that everyone visiting your site gets to see the updated content.

If you need the content to be secure and only accessible by authorized users, you should take the approach outlined in this forum post using private keys: Create Private Pages that are accessible only after authorization.

Or, if you are creating a page that you just want to add some hidden content to, and it is okay if people are able to dissect API requests or code to figure out what’s in the hidden content, you can create a page in Builder and add an input with a hardcoded password field and have it only show the proper content when the correct password is entered. This content is not secure and can still be read by anyone, but it is hidden, which may be enough for your use case. Here is a Builder page that takes that approach (password is secret-password): Super secret page

You can see that the content is hidden from view until you enter the correct password. To build a similar page, take a look at the source fiddle: Builder.io: Drag and drop page builder and CMS

The main concept is that you add an input to the page, and attach a change handler to that input to set the current password to whatever the visitor has entered. Then, attach a click handler to a button that will set a state variable to show the protected content only if the password entered is correct.