Hi,
It is doable, but it is medium difficulty.
Honestly, it’ll be much easier if you use CloudCode for that use-case, that’s what it was designed for.
However, for completeness, I’ll elaborate how to do it with the custom server.:
Short Version: The cloud-code package has npm packages of the services’ api’s for local authoring.
You can basically pull those into your own node.js server and use them from there. You will need to authenticate on your own.
Example of where to find npm packges: \Library\PackageCache\com.unity.services.cloudcode@2.6.2\UnityServicesNpmLocal~
The API is also explained here: Unity Services Web API docs
You can either use the npm’s above, or generate from the Open API specification.
Here’s an example js script through cloud code. You will be writing very similar code.
You DONT need to use cloudcode, it just happens to be in JS so it helps your case. Your life would be a lot easier if you did, since they already integrate out of the box since with CloudCode though, you already have player and trusted authentication.
Long version:
I noticed you talking about admin APIs and auth. Let me clarify some of that.
We’re mixing 2 intersecting things here.
APIS: Admin API / Client API
Authentication: Admin auth, Client Auth, Server Auth*
Client APIs are the ones that change player state (like a game client / game binary would)
Admin APIs are the ones that change service settings (like you would through the dashboard / deployment window)
Player authentication is how the game client authenticates, so that a player CANNOT change different player’s state or admin settings.
Admin authentication can change admin settings AND can change ANY player state (since its an admin operation)
| Admin Auth | Client Auth
Admin API | Dashboard | Impossible
Client API | "Trusted" | Game Client
*Server auth: when running a Multiplay server or CloudCode
The main issue you’ll face is getting authenticated, you could pass the token from the game client to your custom server, or create a service account token like in the documentation you linked.
Granted it is doable, but isnt easy, it is not a use-case we have focused on, as we look more at the Unity server and CloudCode options.
If you were using a different dedicated server (like Python or C++), would be doable but harder still, as you don’t even have a package, you’d need to generate one from the OpenAPI specs.
Hope it helps,
Cheers,
Gab