Skip to content

Profile

FRVR.profile exposes the current player’s channel‑assigned identity — a stable ID, and (on channels that still expose it) a display name and photo. It’s always available, even before auth has completed, because it comes from the channel itself.

const id = FRVR.profile.id();
// 'fbig_123456789' on Facebook Instant, 'gp_ABCDEF' on Google Play, etc.

const name  = FRVR.profile.name?.();    // may be empty — see below
const image = FRVR.profile.image?.();   // may be empty — see below

const locale = FRVR.profile.getLocale();   // 'en-US', 'pt-BR', 'ja'

Use FRVR.profile.id() to key any local data that should follow the player on this device. For cross‑device identity, use FRVR.auth.getFRVRID() instead.

Facebook Instant: name & photo are no longer available

Section titled “Facebook Instant: name & photo are no longer available”

On other channels (Google Play, iOS, web channels) name and photo continue to behave as before — where available. Always ?.()‑guard both reads.

FRVR.profile.getLocale() returns the player’s locale as a BCP 47 tag, such as en-US, pt-BR, or ja.

const locale   = FRVR.profile.getLocale();
const language = locale.split('-')[0];
loadStrings(SUPPORTED.includes(language) ? language : 'en');

It picks the first of these that gives a usable value:

  1. The language the channel reports. YouTube Playables and Facebook Instant have their own setting, which is the one the player chose in the host app.
  2. The browser’s: navigator.languages, then navigator.language.
  3. en-US.

The result is normalised, so Facebook’s en_US comes back as en-US. The call never throws and never returns an empty string. It can return a bare language (ja) when that is all the host reports, so match on the language part before the region.

Call it after FRVR.bootstrapper.init() has resolved. Before that, a channel may not know its language yet and you get the browser’s. There is no change event, so read it once at startup.

Profile: read player id

loading SDK…