Learn how to use FlockSDK via a script tag to power referrals on your site.
FlockSDK
in your scripts.
New: UseA placement renders a Flock referral modal within your app, making it easy to prompt users to share and participate in your referral program.addPlacement(placementId)
on the singleton for opening campaign pages. Each campaign component now has a uniqueplacementId
for robust and future-proof integration.
renderWidget()
method is now deprecated and will be removed in a future release.renderWidget()
to addPlacement(placementId)
.Deprecated:renderWidget()
is now deprecated. UseaddPlacement(placementId)
for all new integrations.
validateReferralCode(code, options)
storage
: Where to store the referral metadata'localStorage'
(default) - Persists in the browserβs local storage, can only be accessed by the same domain.'cookie'
- Useful for cross-subdomain scenarios.cookie
storage option. This allows the referral data to be shared between subdomains of the same root domain.createReferral()
identify()
before addPlacement()
or createReferral()
.Role | Key Methods |
---|---|
Referrer | identify , addPlacement |
Invitee | validateReferralCode , createReferral |