Private Page Authentication

Builder content link

Builder public api key
03bbe3ee2de245dd8f0001b359486d3f

What are you trying to accomplish
I’m trying to make builder pages private and only accessible to authenticated users within my app. I followed this post Create Private Pages that are accessible only after authorization and was able to successfully get the page from the content api. However, where I’m running into an issue is getting the content to render in the builder component.

Screenshot 2022-12-23 at 9.02.52 AM

The content results array is being passed into the content property but the content never renders.

As a side note, I see 401 errors in the logs which appear to be coming from builders default behavior which is trying to load the page on init. How can I prevent that and only use the data I’m fetching from the content API?

Code stack you are integrating Builder with
Angular 14

Hi @spm922,

Welcome to the builder forum.

For the above issue, you may find help at Angular integration

Hi Manish,

This doesn’t seem to address my specific use case where I need fetch private pages from the builder API and display the component to authenticated users. Do you have any guidance for that?

Hi @spm922!

So in this case most likely you would have to fetch the data and pass in the specific content to the component. Could you try something like below?

<builder-component [content]="myFetchedContent">

Hi @manish-sharma,

This is what I’ve been trying. I’m fetching the content from the content API and passing the results object into the content property of the builder-component. However, nothing renders on the browser.

Is this the correct way to do this?

Hi @spm922,

please refer to the forum post Create Private Pages that are accessible only after authorization - #4 by manish-sharma