Home > Net >  Pull URL's referral info with NextJS
Pull URL's referral info with NextJS

Time:05-28

I'm trying to create a referral system for an app by adding a referral link defined as:

const link = `${global.origin}?ref=${address}`;

which returns something like http://localhost:3000/?ref='address'

I'm struggling to find a way to get Nextjs to pull just the 'address' part of the url (and define it to be used in a function).

CodePudding user response:

If I get it right you can use router.query["ref"] from Next router.

  • Related