I am using kinde to set up a subscription form to build a waitlist and generate interest on the landing page of my app before it is ready for the public. After subscription, I am redirected to
Hey @NanaGaisie, Thanks for reaching out. Always happy to give guidance on your approach to implementing Kinde.
Based on the code you've provided, it seems like you've implemented the Kinde subscription form correctly in your Next.js app. The script for the Kinde widget is correctly added and removed on component mount and unmount, and the form appears to be set up correctly with the necessary data attributes.
The success message you're seeing after subscription and the 400 error when a user who has already subscribed tries to subscribe again are both expected behaviors. The success message indicates that the subscription process is working as expected, and the 400 error is Kinde's way of preventing a user from subscribing multiple times with the same email address.
If you want to improve the user experience, you could add some error handling to display a friendly message when a user who has already subscribed tries to subscribe again. However, this would require making a request to the Kinde API to check if the user's email is already in the list of subscribers, which might not be feasible depending on your application's requirements.
Overall, it seems like you've done a good job implementing the Kinde subscription form in your Next.js app. If you have any other questions or run into any issues, feel free to ask!
Hey @NanaGaisie - just regarding the success message, did you want it to display directly below the form after a user signs up (ss attached)? I believe this is the default behaviour, but if you're not seeing this - could I quickly check if the <script> you've copied from Kinde admin looks like <script src="https://widgets.localkinde.me/v1/js/subscribe.js"></script>? Noticed there may be an encoding err, so the quotes may be appearing as "e; - changing them over to "" should resolve this, I'll update in Kinde. Thanks!
Hi @viv (kinde), Yes I want to display the success message directly below after the user signs up. I am using a useEffect to add the script to the dom when the component mounts. I have the code below. I am not getting the expected behavior.
Hi @NanaGaisie - I've fixed up the encoding issue in Kinde admin -> Design -> Subscribe, would you mind copying over the HTML/CSS/JS generated there and trying again? Thank you!
Hi Murtazak - can I check where it is redirecting to? Also are you seeing a pattern in this behaviour (ie just on success / just on failure) or is it just occurring randomly? Thanks!
Hey @Murtazak, Are you able to share where the users are being redirected to? Also, are you able to share a recording (or screenshot) of this issue? You can DM me of you prefer.
Hey, using dangerouslySetInnerHTML for setting a subscription form works as expected. The form does not listen to user preference for setting the theme to light or dark. Setting the global preference for theme in the globals section for design does not affect the subscription form and email theme.
Hey @NanaGaisie, Would you be willing to share a recording (or screenshot) showing this issue where the dark/light mode theme does not work with using dangerouslySetInnerHTML? You can DM me if you prefer.
Add a reply
Sign up and join the conversation on Discord
? Noticed there may be an encoding err, so the quotes may be appearing as "e; - changing them over to \"\" should resolve this, I'll update in Kinde. Thanks!","dateCreated":"2024-01-23T03:18:25.879Z","dateModified":"2024-01-23T03:18:25.879Z","author":{"@type":"Person","url":"https://community.kinde.com/members/45409868-4c22-4a1e-9422-16ebb09b8ccb","name":"viv (kinde)","identifier":"45409868-4c22-4a1e-9422-16ebb09b8ccb","image":"https://cdn.discordapp.com/avatars/1070899329251942480/959537b4233a34e06c5156a27ebd2620.webp?size=256"},"commentCount":0,"comment":[],"position":6,"upvoteCount":0},{"@type":"Comment","text":"Hi @viv (kinde),Yes I want to display the success message directly below after the user signs up. I am using a useEffect to add the script to the dom when the component mounts. I have the code below. I am not getting the expected behavior. useEffect(() => { const script = document.createElement(\"script\"); script.src = `https://widgets.kinde.com/v1/js/subscribe.js`; script.async = true; document.body.appendChild(script); return () => { document.body.removeChild(script); }; }, []);","dateCreated":"2024-01-23T07:40:26.622Z","dateModified":"2024-01-23T07:40:26.622Z","author":{"@type":"Person","url":"https://community.kinde.com/members/64ea170e-c0c7-4e23-b25c-74b61dc302f2","name":"NanaGaisie","identifier":"64ea170e-c0c7-4e23-b25c-74b61dc302f2","image":"https://cdn.discordapp.com/embed/avatars/2.png"},"commentCount":0,"comment":[],"position":7,"upvoteCount":0},{"@type":"Comment","text":"Hi @NanaGaisie - I've fixed up the encoding issue in Kinde admin -> Design -> Subscribe, would you mind copying over the HTML/CSS/JS generated there and trying again? Thank you!","dateCreated":"2024-01-23T23:46:58.792Z","dateModified":"2024-01-23T23:46:58.792Z","author":{"@type":"Person","url":"https://community.kinde.com/members/45409868-4c22-4a1e-9422-16ebb09b8ccb","name":"viv (kinde)","identifier":"45409868-4c22-4a1e-9422-16ebb09b8ccb","image":"https://cdn.discordapp.com/avatars/1070899329251942480/959537b4233a34e06c5156a27ebd2620.webp?size=256"},"commentCount":0,"comment":[],"position":8,"upvoteCount":0},{"@type":"Comment","text":"Thank you @viv (kinde), will try it and give you a feedback on that.","dateCreated":"2024-01-24T07:08:15.415Z","dateModified":"2024-01-24T07:08:15.415Z","author":{"@type":"Person","url":"https://community.kinde.com/members/64ea170e-c0c7-4e23-b25c-74b61dc302f2","name":"NanaGaisie","identifier":"64ea170e-c0c7-4e23-b25c-74b61dc302f2","image":"https://cdn.discordapp.com/embed/avatars/2.png"},"commentCount":0,"comment":[],"position":9,"upvoteCount":0},{"@type":"Comment","text":"Hello I have setup the form using the steps and script when user submit it sometime redirect and sometime stay in same place how to fix that behavior","dateCreated":"2024-02-20T11:06:32.342Z","dateModified":"2024-02-20T11:06:32.342Z","author":{"@type":"Person","url":"https://community.kinde.com/members/2c91dcd8-6edd-4b79-89d7-feaebee38be2","name":"Murtazak","identifier":"2c91dcd8-6edd-4b79-89d7-feaebee38be2","image":"https://cdn.discordapp.com/avatars/765767882780180490/4ecb271bfade88c4eb0c338730b7506d.webp?size=256"},"commentCount":0,"comment":[],"position":10,"upvoteCount":0},{"@type":"Comment","text":"Hi Murtazak - can I check where it is redirecting to? Also are you seeing a pattern in this behaviour (ie just on success / just on failure) or is it just occurring randomly? Thanks!","dateCreated":"2024-02-21T03:01:23.381Z","dateModified":"2024-02-21T03:01:23.381Z","author":{"@type":"Person","url":"https://community.kinde.com/members/45409868-4c22-4a1e-9422-16ebb09b8ccb","name":"viv (kinde)","identifier":"45409868-4c22-4a1e-9422-16ebb09b8ccb","image":"https://cdn.discordapp.com/avatars/1070899329251942480/959537b4233a34e06c5156a27ebd2620.webp?size=256"},"commentCount":0,"comment":[],"position":11,"upvoteCount":0},{"@type":"Comment","text":"Yes I have notice a pattern when user is logged its redirect and when user is logged out it shows message below","dateCreated":"2024-02-26T09:38:11.736Z","dateModified":"2024-02-26T09:38:11.736Z","author":{"@type":"Person","url":"https://community.kinde.com/members/2c91dcd8-6edd-4b79-89d7-feaebee38be2","name":"Murtazak","identifier":"2c91dcd8-6edd-4b79-89d7-feaebee38be2","image":"https://cdn.discordapp.com/avatars/765767882780180490/4ecb271bfade88c4eb0c338730b7506d.webp?size=256"},"commentCount":0,"comment":[],"position":12,"upvoteCount":0},{"@type":"Comment","text":"Hey @Murtazak,Are you able to share where the users are being redirected to?Also, are you able to share a recording (or screenshot) of this issue? You can DM me of you prefer.","dateCreated":"2024-02-27T03:01:55.402Z","dateModified":"2024-02-27T03:01:55.402Z","author":{"@type":"Person","url":"https://community.kinde.com/members/dca83a98-28cd-4b7a-b3ef-1ff081d8cb06","name":"Oli - Kinde","identifier":"dca83a98-28cd-4b7a-b3ef-1ff081d8cb06","image":"https://cdn.discordapp.com/avatars/1070911217834664008/ec34c475562119cca571a7eea85e1f39.webp?size=256"},"commentCount":0,"comment":[],"position":13,"upvoteCount":0},{"@type":"Comment","text":"Hey, using dangerouslySetInnerHTML for setting a subscription form works as expected. The form does not listen to user preference for setting the theme to light or dark. Setting the global preference for theme in the globals section for design does not affect the subscription form and email theme.","dateCreated":"2024-03-07T08:34:24.811Z","dateModified":"2024-03-07T08:34:24.811Z","author":{"@type":"Person","url":"https://community.kinde.com/members/64ea170e-c0c7-4e23-b25c-74b61dc302f2","name":"NanaGaisie","identifier":"64ea170e-c0c7-4e23-b25c-74b61dc302f2","image":"https://cdn.discordapp.com/embed/avatars/2.png"},"commentCount":0,"comment":[],"position":14,"upvoteCount":0},{"@type":"Comment","text":"Hey @NanaGaisie,Would you be willing to share a recording (or screenshot) showing this issue where the dark/light mode theme does not work with using dangerouslySetInnerHTML? You can DM me if you prefer.","dateCreated":"2024-03-08T00:49:24.995Z","dateModified":"2024-03-08T00:49:24.995Z","author":{"@type":"Person","url":"https://community.kinde.com/members/dca83a98-28cd-4b7a-b3ef-1ff081d8cb06","name":"Oli - Kinde","identifier":"dca83a98-28cd-4b7a-b3ef-1ff081d8cb06","image":"https://cdn.discordapp.com/avatars/1070911217834664008/ec34c475562119cca571a7eea85e1f39.webp?size=256"},"commentCount":0,"comment":[],"position":15,"upvoteCount":0}],"author":{"@type":"Person","url":"https://community.kinde.com/members/64ea170e-c0c7-4e23-b25c-74b61dc302f2","name":"NanaGaisie","identifier":"64ea170e-c0c7-4e23-b25c-74b61dc302f2","image":"https://cdn.discordapp.com/embed/avatars/2.png"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0}}]