PlayKit.ai

Javascript SDK Overview

Integrate AI text generation, image generation, and NPC conversations in web games

JavaScript SDK

We know you love using web technologies, so in addition to mainstream game engines, we provide PlayKit's TypeScript/JavaScript library, enabling you to develop AI-native games using web technologies.

The easiest way to get started with the SDK is to install and initialize it via npm.

Before You Begin

  • You need to create an application on the PlayKit Platform and obtain a Game ID
  • Your project needs to support modern JavaScript (ES2017+)
  • A modern browser

Installation

Via Vibe Coding Tools

Visit the Vibe Coding page and copy the prompt into your AI development tool (such as Cursor, Trae, or Claude Code).

Via npm

npm install playkit-sdk

Via yarn

yarn add playkit-sdk

Via CDN (UMD)

<script src="https://unpkg.com/playkit-sdk@latest/dist/playkit-sdk.umd.js"></script>
<script>
  const sdk = new PlayKitSDK.PlayKitSDK({
    gameId: 'your-game-id',
    developerToken: 'your-token'
  });
</script>