You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -879,6 +886,88 @@ This example is being done entirely on the client, however, a more common patter
879
886
880
887
---
881
888
889
+
### Prompting Users to Share Incentivized Links
890
+
891
+
Incentivized sharing can help grow your Activity through network effects. This guide covers implementing a reward system for users who share links and those who click them.
892
+
893
+
#### Implementation Overview
894
+
1. Create and track an incentivized link for a promotional campaign, then prompt users to share the link
895
+
2. Handle incoming referrals and grant valid rewards
896
+
897
+
#### Sharing Links
898
+
899
+
When implementing sharing, you'll need to:
900
+
1. Generate a unique ID for tracking the promotion
901
+
2. Call the [`shareLink`](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelink) command
902
+
3. Track the share attempt
903
+
904
+
```javascript
905
+
// Generate a unique ID for this promotion
906
+
// This could be per-campaign, per-user, or per-share depending on your needs
console.error('Failed to process referral:', error);
959
+
}
960
+
}
961
+
```
962
+
963
+
#### Link Sharing Best Practices
964
+
- Generate unique, non-guessable `customId`s
965
+
- Track and validate referrals to prevent abuse
966
+
- Handle edge cases like expired promotions gracefully
967
+
- Consider implementing cool-down periods between shares
968
+
969
+
---
970
+
882
971
### Preventing unwanted activity sessions
883
972
884
973
Activities are surfaced through iframes in the Discord app. The activity website itself is publicly reachable at `<application_id>.discordsays.com`. Activities will expect to be able to communicate with Discord's web or mobile client via the Discord SDK's RPC protocol. If a user loads the activity's website in a normal browser, the Discord RPC server will not be present, and the activity will likely fail in some way.
0 commit comments