question

kuabscom avatar image
kuabscom asked

PlayFab x Unity SDK Question: Developer Secret Key,PlayFab x Unity Integration: Developer Secret Key

Hi all, question for those of you who have used PlayFab with Unity.

The first thing I did was download the editor extension for managing the Unity PlayFab SDK:

https://learn.microsoft.com/en-us/gaming/playfab/sdks/unity3d/

When you do that, you're greeted in the Unity Editor to login. Did that. Then you're prompted to select a title, and when you do so, it auto-prefills (or if you're manually entering, requires) the Developer Secret Key. Once selected, I can see in Plastic that this is exposed in 2 files:

  • Assets/PlayFabEditorExtensions/Editor/Resources/PlayFabEditorPrefsSO.asset

  • Assets/PlayFabSDK/Shared/Public/ResourcesPlayFabSharedSettings.asset

The editor suggests I can't make API calls without filling this out, but in another part of the docs (searching now) I saw that we absolutely should not ship this secret into any client build. Which has me kinda confused-- how do I start building out the game if the first step I've found in the docs is exposing a secret?

apisunity3d
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Neils Shi avatar image
Neils Shi answered

Since the Developer Secret Key will give the caller all access of Server API and Admin API, so, you should not add the Secret Key to the clients. If you are developing the client-side logic using Unity, then you don’t need to set the Secret Key. Because calling Client APIs does not require the Secret key, it requires the Session ticket (obtained by the login APIs). And if you have any requirement on using Server APIs on client side, you can implement it via Azure Function.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.