Make your first function call
Let’s make a simple function call to retrieve the SDK version. It allows you to check whether the SDK works correctly. You can examine the response in the Console tab of your browser’s DevTools.
import { TentuPlay } from '@tentuplay/js-client-sdk';
const tp = new TentuPlay({
clientKey: "{clientKey}", (1)
});
tp.onInit(() => {
console.log(tp.SDKVersion);
})
1 | This is the client key that you obtained from the TentuPlay console. |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>TentuPlay JavaScript SDK</title>
<script src="YOUR_SDK_FILE_PATH"></script>
<script>
const tp = new TentuPlay({
clientKey: "{clientKey}", (1)
});
tp.onInit(() => {
console.log(tp.SDKVersion);
})
</script>
</head>
<body></body>
</html>
1 | This is the client key that you obtained from the TentuPlay console. |