Web SDK Installation
VLPlay Web SDK is distributed as a hosted JavaScript bundle. Include it in your project via CDN — no package manager required. The SDK is written in TypeScript and works in any modern browser, compatible with React, Vue, Angular, Unity WebGL, or vanilla JavaScript.
Include via CDN
Add one of the following snippets to your HTML file before your game or app code.
- ES Module (recommended)
- UMD / Global (legacy)
<script type="module">
import { VLPlaySDK } from 'https://lib.vlplay.vn/sdk/latest/vlplay.esm.js';
// SDK is ready to use
</script>
<!-- Adds window.VLPlaySDK -->
<script src="https://lib.vlplay.vn/sdk/latest/vlplay.min.js"></script>
The SDK CDN is access-restricted. You will receive your CDN credentials (token or authorized domain) from your VLPlay representative.
Pinning a Specific Version
It is recommended to pin a specific version in production to avoid unexpected breaking changes:
<script src="https://lib.vlplay.vn/sdk/1.0.0/vlplay.min.js"></script>
See the Changelog for available versions.
Content Security Policy
If your site uses CSP, add these directives:
connect-src https://gw.vlplay.vn;
frame-src https://auth.vlplay.vn;
script-src https://lib.vlplay.vn;
TypeScript Support
If you are using TypeScript in your project, type definitions are available as a separate package provided by your VLPlay representative:
// After including the CDN script, cast the global:
declare const VLPlaySDK: import('@vlplay/sdk-types').VLPlaySDKType;
Next: Initialization