Skip to content

A collection of API modules, written in TypeScript, designed for use with Deno.

License

Notifications You must be signed in to change notification settings

quantumhousegames/deno-playfab-sdk

Repository files navigation

PlayFab SDK for Deno

GitHub tag (latest by date)

A collection of API modules, written in TypeScript, designed for use with Deno. All the modules at the root are auto generated and based on the API Specs Provided by PlayFab. Each module exposes its related models as TypeScript interfaces, and all API operations are exposed as functions which return promises.

Example

Let's say we wanted to use the Add News feature of Title-Wide Data Manangement. We'd write the following code:

import { AddNews } from "https://deno.land/x/playfab_sdk@VERSION/admin.ts";

const request = {
  Title: "My news title",
  Body: "My news body",
};

const options = {
  titleId: "YOUR_TITLE_ID",
  security: { SecretKey: "YOUR_SECRET_KEY" }
}

const result = await AddNews(request, options);

Note that the security option accepts only one of SecretKey, EntityToken, or SessionTicket per request. Additionally, some APIs do not require any security.

TIP: Always use a pinned version to ensure APIs don't change unexpectedly on you.

Documentation

Each module comes with extensive focused documentation:

Updating the Generated APIs

This repo vendors in the API Specs project as a git submodule, so ensure it is fully initialized before starting.

From the root of this project run the following command:

deno run --allow-read --allow-write ./scripts/generate_apis.ts

Versioning

The versioning of this repo will track the release versioning of the PlayFab SDK found here: https://docs.microsoft.com/en-us/gaming/playfab/release-notes/

In the event that we need to fix a bug we will do point releases after that, for example: 210315.1.

Copyright and Licensing Information:

Apache License -- Version 2.0, January 2004 http://www.apache.org/licenses/

Full details available within the LICENSE file.