I'm trying to get a handle on writing Cloud Script code in Visual Studio using TypeScript, but I have no idea how to actually use Playfabs API / SDK in this development environment.
I'm sure it's something simple, but I can't seem to figure it out.
Any help in getting this figured out is greatly appreciated!
Answer by Joshua Strunk · Oct 30, 2017 at 10:52 PM
Just in case you haven't, have you looked at the example repo https://github.com/PlayFab/SdkTestingCloudScript for VS TypeScript Cloud Script integration? There is also this blog post which goes over it for VSCode https://blog.playfab.com/blog/typescript2
If you have looked at those could you post more details on what is confusing you or giving you trouble.(unfortunately I am more familiar with compiling TypeScript from command line and editing it with VSCode, but can try and help)
Well I'm just trying to get the Playfab API to be in the type predictions while using TypeScript!
I have everything else but that going fine!
You need to be sure the .d.ts files found at https://github.com/PlayFab/SdkTestingCloudScript/tree/master/Scripts/typings/PlayFab is contained in the files marked for inclusion in your tsconfig.json file. You may also need to ensure you have compilerOptions.outFile set as well.
I have also noticed that some IDEs will only intellisense on open files. If that is the case you might need to open the CloudScript.d.ts file in a tab which you will have to leave open while working on your project. If you need to also explicitly type something to a server api model you should be able to access them by through the namespace`PlayFabServerModels.`.
Ahhhh okay okay This is the type of thing I thought I was missing!
Thanks!!
Getting InvalidDropTable when calling EvaluateRandomResultTable 1 Answer
Are Epic Games Store SDK API calls available as a REST API callable by a Cloud Script? 1 Answer
Where should I write cloud script code? ,Where do I actually write cloud script code? 1 Answer
No confirmation email is received. 5 Answers
Advantages of CloudScript over Calling JavaScript from Node.js 1 Answer