Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
/ activitysdk-ts Public archive
forked from bignutty/activitysdk

Unofficial SDK to build embedded activities.

License

Notifications You must be signed in to change notification settings

UserUNP/activitysdk-ts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ActivitySDK

activitysdk-ts activitysdk
npm npm

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.login("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);
});

About

Unofficial SDK to build embedded activities.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%