Skip to content

Hiding sensitive data during an API request #28284

Answered by logantai24
alanakra asked this question in Help
Discussion options

You must be logged in to vote

@alanakra instead of directly sending out sensitive data (API token) in frontend, you might consider using the api routes functionality of Nextjs?

Nextjs App (frontend)
Sends a POST request to an api route you created, which includes the form data.

API (Vercel Serverless Functions)
Retrieve the form data, send a POST request to the trello API and write that form data to Trello. Sensitive data is store in env which only exposes to this API.

By doing so, the sensitive data will not be exposed in browser as all the actual send form data to trello API logic is done within the API endpoint you created in the pages/api/ folder.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@alanakra
Comment options

@elouisramsey
Comment options

@alanakra
Comment options

@afaqahmedkhan
Comment options

Answer selected by alanakra
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants