PlayFab API | Roblox Integration

Github
Playfab_API.rbxm (69.5 KB)

Hello all! I am pleased to present to you all a roblox integration version of the PlayFab API. For those of you who don’t know what PlayFab is it is a dashboard that will allow you to add various engagement and analytic features into your game from the web. This is a very powerful tool when it comes to roblox development and to my knowledge nobody has given any api port to work with roblox.

Why would I want this?

If you’re currently a live game with lots of players. You may want custom analytics for your game. This will help you determine certain problems, weather it be maybe a product isn’t selling well, or maybe players are having trouble with a certain part of your game and it ends up hurting your game overall. PlayFab offers a dashboard that will allow you to read such analytics and determine a course of action accordingly.

Now analytics isn’t all you could do! A few examples is making your entire item shop on the web, virtual currency on the web and purchases can be done with one simple api call!

For further references I suggest referring to the Playfab API Documentation

Tutorial

17 Likes

For those using the roblox version. I appear to of updated an outdated version and I have since fixed it so please download the new version :slight_smile:

I was checking out the API and experienced a consistent error about Muse be logged in to call this method when using the Client API’s LoginWithCustomID and then UpdateUserTitleDisplayName with the following code:

local loginPlayer = function(player)
	clientApi.LoginWithCustomID({
		CreateAccount = true,
		CustomId = player.UserId
	},function(result)
		playFabIds[tostring(player.UserId)] = result.PlayFabId;
		local update = {
			PlayFabId = result.PlayFabId,
			DisplayName = player.Name
		}
		clientApi.UpdateUserTitleDisplayName(update,function(result)
			print(result);
		end,function(err)
			warn("Failed to update display name:",err);
		end)
	end,function(err)
		warn("Failed to login player:", err.errorMessage);
	end)
end

I was able to fix it by adding the following to PlayFabClientApi.lua at line 917.

PlayFabSettings._internalSettings.sessionTickets[result.PlayFabId] = sessionTicket;

Is this expected/intended behavior or a bug?
side note: is ‘Muse’ a typo?

Otherwise, so far this is a cool resource, keep up the great work!

1 Like

The LoginWithCustomID shouldn’t have a check for if the client is logged in. This is intended behavior if the PlayFab ID is not valid when using the client api but yes, this is intended behavior since there needs to be a session ticket for each PlayFabID when using the client api, and only the client api. If there is not one or the session ticket is invalid then the client will be seen as not logged in.

I can understand the confusion though, for most engines the way to handle a client api would be well, on the client. Sadly, roblox handles such systems very differently so it may seem a bit weird at first.

I also briefly go over this concept in the basics tutorial I posted if you want some reference for what I’m referring to.

1 Like

Isn’t this already possible with AnalyticsService, and yes I know that AnalyticsService is invite-only.

AnalyticsService is very limited in functionality, It is as the name suggests, only for analytics. (I am rolled-in to the program)