yup-api-interact
v0.1.7
Published
Simple class library to interact with Yup Api and post using your token or private key.
Downloads
12
Maintainers
Readme
yup-api-interact
Simple library to intercat with YUP API mainly for creating posts. Works with either the private key of the yup account or a yup account token. If private key is used token will be generated on the fly and stored in the class instance.
Usage
import { YupAPI } from 'yup-api-interact';
import { PK, token } from './secret';
const yupAPI = new YupAPI( PK ? { PK } : { token });
yupAPI.sendPost({
content: 'Hello World',
media: ['https://example.com/image.jpg'],
platforms: ['twitter', 'bsky', 'threads', 'farcaster', 'lens'],
}).then((res) => {
console.log(res);
}).catch((err) => {
console.error(err);
});
Notes
For now class is mainly used for posting content.
The type of argument for sendPost is exported as ISendPostData
, all necesary types are exported.