Case study · Backend problem solving

    Twitter login for a Unity WebGL game with PlayFab and Azure Functions

    Invision needed PlayFab leaderboards and sign in with both email and Twitter for a Unity WebGL game. Twitter login could not run on the WebGL client side, so I moved it to the server with an Azure serverless function invoked through PlayFab CloudScript.

    Client
    Invision
    Year
    2023
    Role
    Unity and backend developer
    Platform
    Web (WebGL)
    UnityC#WebGLPlayFabCloudScriptAzure Functions
    Event registration screen with the Twitter login option
    Event registration screen with the Twitter login option
    In game damage ranking leaderboard powered by PlayFab
    In game damage ranking leaderboard powered by PlayFab
    Logged in player state after sign in
    Logged in player state after sign in

    The challenge

    WebGL builds run inside the browser sandbox, and the Twitter API flow needed for login did not work from the WebGL client side. A client only integration was ruled out, so the login flow had to move off the client.

    What I built

    • PlayFab authentication with email login
    • Twitter login routed through an Azure serverless function
    • PlayFab CloudScript calls from Unity to invoke the function
    • PlayFab leaderboards

    Results

    • Email and Twitter login working in the WebGL build
    • Third party API calls kept on the server side, out of the browser build
    Work together

    Need something similar built?

    Tell me about your game, your stack and your timeline. I reply within one business day with questions or a clear next step.

    More case studies