npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

easy-bsky-bot-sdk

v0.1.2

Published

A typescript SDK for easily writing bots for https://bsky.app

Downloads

41

Readme

easy-bsky-bot-sdk

A typescript SDK for easily writing bots for bsky.app

Current supported version: 0.1.2

Please use this SDK responsibly. You are responsible for your use of this bot. Please be a good citizen of the AT Protocol and the Bluesky communities in which your bot participates. We have an amazing opportunity to build a better social web: let's not waste it.

In particular, please try not to spam people's notifications or timelines, and be careful not to get into infinite loops with other bots.

Status

This project is in the extremely early stages. It is missing many desirable or possibly even essential features. PRs are welcome -- see the contribution guide at the bottom of this readme for more details.

This project is likely to contain bugs and usability issues.

You should assume that every release will have breaking changes. However, if at all possible, please do your best to upgrade to new versions when they're available. They will likely include important upgrades to the functionality, reliability, and network citizenship of your bot.

Installation

A recent version of Node.js is required. If you don't have node installed, I recommend installing it with nvm.

npm install --save easy-bsky-bot-sdk

Basic Usage

The Typescript types should explain most of how to use the BskyBot class, hopefully this is pretty intuitive.

There is a simple example project in the examples/ directory.

import { BskyBot, Events } from "easy-bsky-bot-sdk.ts";

async function main() {
  // you are required to call this once, globally
  // this information will go in the bot's user-agent string, so it will be visible to the server you connect to but no one else
  BskyBot.setOwner({ handle: "your.handle.here", contact: "[email protected]" });

  // there are a number of optional parameters in addition to the only required parameter, your bot's handle
  const bot = new BskyBot({ handle: "your.bot.handle.here" });

  // ideally don't hardcode your password, get it from environment variables or similar
  await bot.login("your-password-here");

  await bot.post({ text: "Hello, world!" });

  // three event types currently supported: MENTION, REPLY, and LIKE
  bot.setHandler(Events.MENTION, async ({ post }) => {
    console.log(`mentioned by @${post.author.handle}: ${post.text}`);
    await bot.like(post);
    await bot.reply("thanks for the mention!", { replyTo: post });
  });

  // you have to start polling for events
  bot.startPolling();
  // bot will now poll forever until you call bot.stopPolling()
}

main();

Contribution guide

PRs are welcome, though not guaranteed to be accepted.

TODO write contribution guide

tl;dr use Prettier, try to stick to the style/patterns of existing code