DEV Community

Discussion on: React js Contentful starting

Collapse
 
5ervant profile image
Mark Anthony B. Dungo

But it'll be like your access token will become vulnerable from extraction if you build your single-page React application directly with Contentful.

Is there any way to secure our access tokens without building another backend application and just use Contentful directly as our backend?

Collapse
 
tarekhassan410 profile image
Tarek Hassan

for that you can use .env files to save your token. I was simplifying the app as best as I can.

Collapse
 
5ervant profile image
Mark Anthony B. Dungo • Edited

But I guess, the token that's stored on your ".env" file will become visible on your single-page React web application's script because it'll be used to fetch your Contentful space' entries?

Look at this: contentful.github.io/gallery-app-r...
That's the bundle script of: contentful.github.io/gallery-app-r...
On that bundle script, you can easily see the tokens...