@cloudplay/sdk

CloudPlay SDK

Usage no npm install needed!

<script type="module">
  import cloudplaySdk from 'https://cdn.skypack.dev/@cloudplay/sdk';
</script>

README

CloudPlay TypeScript SDK

Usage

import CloudPlay, { UserRequestMessages } from "@cloudplay/sdk";

const cloudplay = new CloudPlay();

cloudplay.initialize({
  endpoint: "...",
  onInit: async function() {
    register();
  }
});

async function register() {
  try {
    const response = await cloudplay.request(UserRequestMessages.REGISTER, {
      email: "user@email.com",
      password: "12345",
    });

    console.log("Success:", response);

  } catch (e) {
    console.error(e.code, e.message);
  }
}