Colin S
Colin S

Reputation: 133

Pull URL's referral info with NextJS

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).

Upvotes: 0

Views: 1493

Answers (1)

amin keshavarzi
amin keshavarzi

Reputation: 111

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

Upvotes: 1

Related Questions