# Embed Payment Link in NextJS

**URL:** <https://community.hubspot.com/t/embed-payment-link-in-nextjs/116707>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [September 19, 2024, 7:06pm UTC](https://community.hubspot.com/t/embed-payment-link-in-nextjs/116707 "2024-09-19T19:06:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MWurpts](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@MWurpts](https://community.hubspot.com/u/MWurpts)\
**Post date:** [September 19, 2024, 7:06pm UTC](https://community.hubspot.com/t/embed-payment-link-in-nextjs/116707/1 "2024-09-19T19:06:23Z")

</div>

I am trying to embed a HubSpot Payments Link on a page in a NextJS app. The payments form is not appearing. I can get this to work in a ReactJS app but not in our NextJS app.

I have created a simple example in codesandbox demonstrating the issue here:

[https://codesandbox.io/p/devbox/nervous-cherry-yh4d2d?file=%2Fpages%2Findex.js%3A21%2C1-32%2C17](https://codesandbox.io/p/devbox/nervous-cherry-yh4d2d?file=%2Fpages%2Findex.js%3A21%2C1-32%2C17)

I’m simply trying to paste the embed code I got from the Payment Link in HubSpot into a simple Hello World NextJS app, but the for does not appear.

---

<div class="post-metadata">

**Author:** ![MWurpts](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@MWurpts](https://community.hubspot.com/u/MWurpts)\
**Post date:** [September 19, 2024, 7:20pm UTC](https://community.hubspot.com/t/embed-payment-link-in-nextjs/116707/2 "2024-09-19T19:20:06Z")

</div>

I tried adding the script using next/script but the form still doesn’t appear.  
I also tried to embed it using an iframe. The form appears but whenever I select one of the dropdown menu fields the page jumps to the top, which makes it unusable.  
Those two attempts are commented out in the codesandbox that I linked above.

---

<div class="post-metadata">

**Author:** ![MWurpts](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@MWurpts](https://community.hubspot.com/u/MWurpts)\
**Post date:** [September 19, 2024, 7:36pm UTC](https://community.hubspot.com/t/embed-payment-link-in-nextjs/116707/3 "2024-09-19T19:36:46Z")

</div>

I am able to get the Payment Link embed to work in a simple ReactJS hello world app as demonstrated here. But, I need it to work in our NextJS website.  
[https://codepen.io/cmmadmin/pen/xxovjYV](https://codepen.io/cmmadmin/pen/xxovjYV)

---

<div class="post-metadata">

**Author:** ![EApaza0](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@EApaza0](https://community.hubspot.com/u/EApaza0)\
**Post date:** [March 13, 2025, 7:44pm UTC](https://community.hubspot.com/t/embed-payment-link-in-nextjs/116707/4 "2025-03-13T19:44:02Z")

</div>

You injected the code outside div=root, the idea is how to include that embed code in a component, so we can control when it should be displayed
