-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Added Unsplash API for image backgrounds #2341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Added Unsplash API for image backgrounds #2341
Conversation
|
@vidhikapadia2799 is attempting to deploy a commit to the formbricks Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for following the naming conventions for pull request titles! 🙏 |
|
hey @vidhikapadia2799 thanks for your PR :) The screenshots look great! Can you pls sign the Contributor CLA and fix the merge conflict? @ShubhamPalriwala will then review your PR. Cheers! |
…feat-unsplash-api
|
Hi @jobenjada, resolved merge conflicts. Also signed contributor CLA. @ShubhamPalriwala Can you please review the PR. Thanks. |
ShubhamPalriwala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @vidhikapadia2799 thanks a lot for the PR 💪🏼 I tested it and the core works pretty nicely. Just some small changes I think we can make to get the PR ready!
-
I think you interchanged the headings by mistake (Image is where Search is, & Upload is the normal upload functionality)
-
Since you are making the API call in a client side environment, the unsplash credentials are visible in the client browser which leads to leaking the secret key. So can you move this to a server side action?

-
Adding to the previous point, lets also make the env var away from
NEXT_PUBLIC_so that its only called server side + self hosters can set the variable at runtime itself.
I've also suggested some code changes below so please take a look!
Realyy excited to see your pace in shipping this 💪🏼 Let me know if you have any doubts or queries!
...app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/UploadSurveyBg.tsx
Outdated
Show resolved
Hide resolved
...app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/UploadSurveyBg.tsx
Outdated
Show resolved
Hide resolved
...app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/UploadSurveyBg.tsx
Outdated
Show resolved
Hide resolved
...app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/UploadSurveyBg.tsx
Outdated
Show resolved
Hide resolved
|
Hey @ShubhamPalriwala , thanks for reviewing PR.
Done with other suggested changes.Can you please have a look and let me know if any other changes required. Looking forward to contribute to formbricks. Thanks. |
|
Hey @vidhikapadia2799, thanks a lot for making the changes! 😄 Looks great! It works nicely too, just one change to keep in line with the product's policies: Currently, in the link survey rendering action, you load the image from unsplash API directly. This might cause issues with the Policy for the end-user who is filling the form as they will be making a call to the Unsplash domain. To tackle this, what we can do is that, once the survey creator selects an image from Unsplash, we upload it in the same way we do if a manual image was uploaded on our servers! In this way, when an end-user views the survey, they get the image from the formbricks servers itself rather than a third-party. Let me know if you have any doubts around this or need some help! |
|
Hi @ShubhamPalriwala , I have made the requested changes. Can you please have a look ? Let me know if any changes are required. Thanks |
|
Hey @vidhikapadia2799, thanks a lot for your changes! They look good, I made some minor UX tweaks & passed the env var from a server component to the client components rather than getting them from a server action. |
|
Hi @ShubhamPalriwala , I have gone through the changes you made and will make sure from next time to keep following way. One thing I noticed, there is one console.log and some commented code in your changes. Do we need to keep that or remove it ? |
|
good catch 😁 i still have some work to do on this PR, once done, I'll ping you as well, so you can understand the changes! thanks again |
…feat-unsplash-api
jobenjada
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment
|
Fixed & Made all the changes as suggested, please take a look 🤞🏼 |
|
/award 500 |
|
Awarding vidhikapadia2799: 500 points! |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|






What does this PR do?
Fixes # (2279)
How should this be tested?
Checklist
Required
pnpm buildconsole.logsgit pull origin mainAppreciated