Social
FRVR.social manages the player’s friends and offers the channel’s native sharing surfaces (share sheet, invite picker, update notifications).
It has three layers:
FRVR.social— FRVR’s own friend graph, synced to the server. Cross‑channel, persistent.FRVR.social.platform— direct access to the channel’s social UIs (Facebook friend picker, iOS share sheet, etc.).FRVR.social.live— a WebSocket connection for real‑time presence and game invites between friends.
FRVR friends
Section titled “FRVR friends”Requires auth.
Default config syncs friends automatically at login:
Platform surfaces
Section titled “Platform surfaces”When the host platform has a native share sheet or invite flow, go through platform. Each call resolves when the user finishes (or cancels) the interaction.
Always check getSupportedAPIs() before wiring a button — not every channel offers every surface.
Share a message
Section titled “Share a message”Posts to the user’s timeline / story / share sheet, depending on the channel.
| Field | Type | Required | Purpose |
|---|---|---|---|
image | string | yes | Image data URL or hosted URL (BASE64 / JPEG / PNG). |
text | string | yes | Body / description text. |
headline | string | no | Short headline above the body, where the channel supports it. |
cta | string | no | Call‑to‑action button label. |
entryPointData | object | no | Arbitrary payload delivered to the recipient via entry point when they open the share. |
Invite friends
Section titled “Invite friends”Opens the channel’s friend picker so the player can invite one or more contacts directly into the game.
| Field | Type | Required | Purpose |
|---|---|---|---|
image | string | yes | Image data URL or hosted URL (BASE64 / JPEG / PNG). |
text | string | yes | Message shown alongside the image. |
headline | string | no | Short headline above the body, where the channel supports it. |
cta | string | no | Call‑to‑action button label. |
entryPointData | object | no | Payload available to the recipient through entry point on join. |
canInvite() returns false on channels where invites are unavailable or the user is in a context where the host disallows them — gate your UI on it.
Send a platform update
Section titled “Send a platform update”Yields control to the platform so it can deliver a templated update (Facebook context update, Snapchat sticker, Discord activity, …). Templates live in @frvr-social/defaultTemplatesConfig — drop the channel‑specific config into your game folder to use them.
| Field | Type | Purpose |
|---|---|---|
template | string | Predefined template name (e.g. 'JOIN_PLAYER'). |
image | string | Image data URL or hosted URL (BASE64 / JPEG / PNG). |
bitmojiVariant | string | Snapchat bitmoji pose — 'HAPPY', 'WINK', 'HEARTEYES', etc. See SDK types for the full list. |
entryPointData | object | Payload delivered via entry point when the recipient opens the update. |
override | object | Channel‑specific raw payloads (snapchat, facebookInstant, facebookRooms, discord) that replace the template fields. |
Friends and context
Section titled “Friends and context”getFriends() returns friends who have played this game on the current channel — best‑effort, subject to each channel’s policies. For the cross‑channel FRVR graph use FRVR.social.getAllFriends() instead.
Try it live
Section titled “Try it live”Live updates
Section titled “Live updates”FRVR.social.live opens a WebSocket so you can react to friends coming online, exchange game invites, and broadcast your own status in real time. Requires auth.
Sending
Section titled “Sending”Snapshot
Section titled “Snapshot”Disconnect
Section titled “Disconnect”The connection is closed automatically on logout.
API summary
Section titled “API summary”FRVR.social — friend graph
Section titled “FRVR.social — friend graph”| Method | Purpose |
|---|---|
syncFriends() | Push the channel’s friend list to FRVR; matches and registers friends with FRVR ids. |
getAllFriends() | Read the synced cross‑channel friend list. |
getFriendByFRVRID(frvrId) | Look up a synced friend by FRVR id. |
getFriendByChannelId(channelId) | Look up a synced friend by their channel‑native id. |
addFriend(frvrId) / removeFriend(frvrId) | Manual graph edits. |
FRVR.social.platform — channel UIs
Section titled “FRVR.social.platform — channel UIs”| Method | Purpose |
|---|---|
shareMessage(config) | Open the channel’s share sheet with image + text. |
invite(config) / canInvite() | Open the channel’s friend invite picker, gated on support. |
sendUpdate(config) | Templated platform update (FB context update, Snap sticker, …). |
getFriends() | Friends on the current channel who play this game. |
getContextId() / getContextData() / getContextPlayers() | The current host context (chat, room, party). |
getSupportedAPIs() / isSupportedAPI(api) | Feature detection — gate UI on the result. |
FRVR.social.live — real‑time
Section titled “FRVR.social.live — real‑time”| Method / Event | Purpose |
|---|---|
connect() / close() | Open or close the WebSocket. Reconnects on auth refresh. |
on(event, cb) | Subscribe to onConnect, onFriendStatusUpdated, onGameInvite, onError. |
updateStatus(metadata) | Broadcast your own presence metadata to friends. |
sendGameInvite(recipientId, lobbyId, metadata?) | Push a direct invite to a friend’s onGameInvite. |
getFriendsStatus() | Last‑known presence snapshot for each friend. |
Social: supported APIs + share