Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by josephtorbett · Oct 30, 2017 at 06:48 PM · CloudScriptapissdks

How can I use the Playfab API while writing a Cloud Script with TypeScript?

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!

Comment
Joshua Strunk

People who like this

1 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

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)

Comment
Joshua Strunk

People who like this

1 Show 3 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image josephtorbett · Oct 31, 2017 at 06:46 PM 1
Share

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!

avatar image Joshua Strunk josephtorbett · Oct 31, 2017 at 07:09 PM 2
Share

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.`.

avatar image josephtorbett Joshua Strunk · Oct 31, 2017 at 07:21 PM 0
Share

Ahhhh okay okay This is the type of thing I thought I was missing!

Thanks!!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    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

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges