Playfab SDK for node.js applications
- Users should be very familiar with the topics covered in our getting started guide.
To connect to the PlayFab service, your machine must be running TLS v1.2 or better.
- For Windows, this means Windows 7 and above
- Official Microsoft Documentation
- Support for SSL/TLS protocols on Windows
The following console command will install the PlayFab NodeSDK. It requires that you have correctly installed node.
npm install playfab-sdk
3b. Example testing project:
The following console command will install the PlayFab NodeSDK example automated-testing project. It requires that you have correctly installed node.
npm install playfab-testing
To run the test, you need to create a testTitleData.json file, explained below. You can place that file in the root of the example beside PlayFabApiTests.ts, or set the full-path location in an environment variable:
Replace "C:/YOUR_PATH" with the location of your testTitleData.json file.
4. testTitleData.json file required for example unit-test-project
This sdk includes an optional example project that is used by PlayFab to verify sdk features are fully functional.
Please read about the testTitleData.json format, and purpose here:
- https://github.com/PlayFab/SDKGenerator/blob/master/JenkinsConsoleUtility/testTitleData.md See the previous section for how to use this file in the example test project.
5. Usage Instructions:
Please read our Node Getting Started Guide for step by step instructions on how to set up a Node environment using our PlayFab NodeSDK.
Below an older guide with less detail:
var PlayFabClient =PlayFabClientsettingstitleId = "F00";PlayFabClient;
Use similar steps to gain access to the PlayFabServer, PlayFabAdmin, and PlayFabMatchmaker APIs. Additionally, you will need to set your developerSecretKey. For security reasons you must never expose this value to players.
PlayFabClient.settings.developerSecretKey = "your secret key";
You can find your titleId and developerSecretKey in the Game Manager -> Settings -> Credentials section for your title: https://developer.playfab.com/en-us/studios
For a complete list of available APIs, check out the online documentation.
We love to hear from our developer community! Do you have ideas on how we can make our products and services better?
Our Developer Success Team can assist with answering any questions as well as process any feedback you have about PlayFab services.
7. Copyright and Licensing Information:
Apache License -- Version 2.0, January 2004 http://www.apache.org/licenses/
Full details available within the LICENSE file.