0.2.2 • Published 1 year ago

activitysdk-ts v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ActivitySDK

activitysdk-tsactivitysdk
npmnpm

Typescript fork of activitysdk.

Example usage:
you need to use a bundler such as vite or webpack or any bundler you like.

import ActivitySDK from "activitysdk-ts";

const sdk = new ActivitySDK("app id");

sdk.on("READY", async () => {
  let user;
  try {
    user = (await sdk.commands.authenticate("app secret", ["identify"])).user;
  } catch (e) {
    console.error("could not authorize/authenticate");
    return;
  }
  
  const info = document.createElement("div");
  info.style.backgroundColor = "gray";
  info.style.display = "inline-block";
  
  const username = document.createElement("p");
  username.innerText = user.username;
  username.style.color = "cyan";
  
  info.append("Hello ", username);
  document.body.append(info);
});
0.2.2

1 year ago

0.2.1

1 year ago

0.1.1

1 year ago