Skip to main content
本教程向你展示使用 Kongregate 和 HTML5/JavaScript 在 PlayFab 中对玩家进行身份验证所需的最小设置。

要求

设置 Kongregate 应用

Kongregate 要求你上传应用的预览版本,然后才能访问必要的 API 信息。 为此,我们需要准备一个具有以下内容的 index.html 文件。
导航到 Kongregate 网站
  1. 选择 Games 选项卡。
  2. 选择 Upload your game 按钮。
Kongregate Games tab 设置新应用的页面打开。
  1. Title 字段中输入应用程序名称
  2. 然后在提供的字段中输入游戏描述
  3. 选择一个类别
  4. 通过选择 Continue 按钮提交新应用,如下例所示。
Kongregate upload your game 你将被移动到 Application Upload 页面。 作为重要的第一步,请务必保存 Web Address Bar 中的 URL。这为你节省了大量在关闭页面后尝试恢复对应用程序访问的时间。
  1. 完成后,选择准备好的 index.html 文件作为你的 Game File
  2. 然后设置屏幕大小。
  3. 请务必接受所有必需的许可证。
  4. 通过选择 Upload 按钮上传你的应用,如下例所示。
Kongregate application upload page
  • 预览打开后,忽略内容并打开 api information 链接。
Kongregate preview API information
API Information 页面打开时,找到 API Key 并将其保存在安全且易于访问的位置以供以后使用。
Kongregate API Key

配置 PlayFab title

在你的 PlayFab title Game Manager 中:
  1. 导航到 Add-ons
  2. 找到并选择 Kongregate
PlayFab select Kongregate Add-on 一个新页面打开,允许你设置 Kongregate 集成。
  1. 输入你在上一节中获取的 API Key
  2. 选择 Install Kongregate
PlayFab set up Kongregate integration 如果你没有收到错误消息,则表示你已配置 PlayFab title 与你的 Kongregate 应用的集成。

准备一些代码

使用下面显示的示例代码填充你游戏的 index.html

测试

还记得我们不久前请你保存在安全且易于访问位置的 URL 吗?现在使用它访问你的 Application Upload 页面。
  1. 选择 index.html 作为你的 Game File
  2. 设置屏幕大小。
  3. 请务必接受所有必需的许可证。
  4. 通过选择 Upload 按钮上传你的应用。
Kongregate application upload page 预览加载后,等待应用程序获取 Kongregate User IDUsername
  • 发生这种情况后,选择 PlayFab Login With Kongregate 按钮。
  • 短暂停顿后,你应收到 Authenticated via PlayFab 消息。
  • 至此,你已成功使用 PlayFab 和 Kongregate 登录!
Testing PlayFab Login with Kongregate
最后修改于 2026年8月13日