Connecting to my API

I created some components in the editor and have connected them to my APIs, based on this post: Connecting your API data to builder - Builder.io

I want to only allow BuilderIO to call my APIs. How do I verify that the requests are coming from BuilderIO?

Richard

Hi @richardchou,

Welcome to the builder.io forum.

In builder, you can create a private key and then you can use our content API to request private content using your private key, e.g.

let apiUrl = 'https://cdn.builder.io/api/v2/content'
let modelName = 'private-page'
let content = await request(`${apiUrl}/${modelName}?apiKey=${yourPublicKey}&limit=1&userAttributes.urlPath=/some-page`, {
  headers: { Authorization: `Bearer ${yourPrivateKey}` },
})

You can read more about them at Create Private Pages that are accessible only after authorization - #2 by steve

Let us know if you have any further questions. Thank you!