@atcute/bluesky-threading

2.0.1 • Public • Published

@atcute/bluesky-threading

create Bluesky threads containing multiple posts with one write.

import { XRPC } from '@atcute/client';
import { AtpAuth } from '@atcute/client/middlewares/auth';

import RichTextBuilder from '@atcute/bluesky-richtext-builder';
import { publishThread } from '@atcute/bluesky-threading';

const rpc = new XRPC({ service: 'https://bsky.social' });
const auth = new AtpAuth(rpc);

await auth.login({ identifier: '...', password: '...' });

await publishThread(rpc, {
	author: 'did:plc:ia76kvnndjutgedggx2ibrem',
	languages: ['en'],
	posts: [
		{
			content: new RichTextBuilder()
				.addText('Hello, please visit my website! ')
				.addLink('example.com', 'https://example.com'),
		},
		{
			content: {
				text: `Here's the second post!`,
			},
		},
		{
			content: {
				text: `Third post for good measure.`,
			},
		},
	],
});

Readme

Keywords

none

Package Sidebar

Install

npm i @atcute/bluesky-threading

Weekly Downloads

14

Version

2.0.1

License

MIT

Unpacked Size

33.5 kB

Total Files

15

Last publish

Collaborators

  • externdefs