User referral codes

I would like to know if there is a native functionality for users to invite people to our platform and register with Kinde that come from that user through some system.
9 Replies
IkiTg07
IkiTg074w ago
Hello, unfortunalety no but it's something i've myself asked in the past so I know it's somewhere in their plan. I'll let them know others are asking for it tho
Samuel Corsan
Samuel CorsanOP4w ago
Thanks @IkiTg07 But do you know if there is a way to do it? Either it has to be outside Kinde, like with the user properties or I don't know, its metadata, or it has to be in my db and that's it.
IkiTg07
IkiTg074w ago
So ive done it twice First time I just created a special link with referral and sent it via SMS or email Second I created the user in kinde using the management api and sent an email for the user to sign in for the account verification. I guess with this method you could wait until the invited user verifies his profile before adding it to the DB So the first time with the referal code inside the url sent to the user i'd check upon signing-up in the callback if there's a referral in the url to use it for other logic (I was using it to flag the referee to its referrer for a fidelity and referral system)
Samuel Corsan
Samuel CorsanOP4w ago
Is it not possible to pass extra props to the form? I mean, for example if the user has the parameter in the URL ?link=12345678 that in the <RegisterLink /> in nextjs or something like that you can put a parameter 12345678 and when the hook of user.created that I have put can be obtained that data and save them in the db. Is there anything like this? and how do you know who invited the new user?
IkiTg07
IkiTg074w ago
I' encoded the params to retrieve the referer id inside later The RegisterLink component from kinde can take postredirecturl as a prop so you'd have to use the post redirect url to which you'll attach your param
Samuel Corsan
Samuel CorsanOP4w ago
But Can I add parameters to send to the register link Or how to encode the params or where to add them to later get them I don’t understand the complete flow Is there a doc for this?
IkiTg07
IkiTg074w ago
Gimme a minute i'll try to be more concise I did it using custom sign-in/up but it should work even with kinde's default pages you'll just need a little extra So what I did when making an invitation auth flow was : - create an invitation link like
www.my-domain.com?ref=12345
www.my-domain.com?ref=12345
(ref here is an id or something that points to the referer user in my DB) - send the link via sms / mail - when someone clicks the link he is redirect to a custom page like
www.my-domain.com/invite
www.my-domain.com/invite
- Here using my custom sign-up or even Kinde Registerlink you make the user registers himself but you'll pass an argument
postLoginRedirectURL
postLoginRedirectURL
either to your custom function or as a props on RegisterLink with my callback in which i'll add the ref URL param. So it will look like
postLoginRedirectURL="www.my-domain.com/register/callback?ref=12345"
postLoginRedirectURL="www.my-domain.com/register/callback?ref=12345"
- On the callback i'll have the logic to get check if there is a ref url param. If so then I'll attach the referer id to the referee. In the end it will let me know User B has registered with a referral link from User A (id 12345) Sorry for the late answer. Hope this helps. Don't mind asking for anything else !
Samuel Corsan
Samuel CorsanOP4w ago
tysm 🙂
IkiTg07
IkiTg074w ago
Hey just a quick note I forgot to say that when i redirect the user to the /invite page i also pass it the ref url param so it's more like
www.my-domain.com/invite?ref=12345
www.my-domain.com/invite?ref=12345
Want results from more Discord servers?
Add your server