/sopia-core

Core api caller package for spooncast

Primary LanguageTypeScriptMIT LicenseMIT

sopia-core

Spoon radio core API https://www.spooncast.net/

Install

npm install sopia-core

or

yarn add sopia-core

Usage

import * as spoon from 'sopia-core';

(async () => {
    const sopia = new spoon.Client('DeviceUUID');
    await sopia.login('Your ID', 'Password', spoon.LoginType.PHONE);
    
    
    const socket = await sopia.liveManager.liveJoin(#Live);
    
    socket.on(spoon.LiveEvent.LIVE_JOIN, (e) => {
        // do something.
        ...
        socket.message('Message');
    });
    
    socket.on(spoon.LiveEvent.LIVE_MESSAGE, (e) => {
        // sender = e.author
    });
})();