Skip to content

tsky-dev/tsky

Repository files navigation

tsky

A lightweight, fast, universal and typed Bluesky API wrapper for Apps & Bots.

⚠️ tsky is still in development and is not ready for production use.

tsky is still in active development and is not ready for production use. If you want to contribute to the project, please read the CONTRIBUTING.md file or join our Discord Server.

tsky is a lightweight, fast, universal and typed Bluesky API wrapper for Apps & Bots. It's designed to be easy to use, lightweight and straightforward to use. It's built with TypeScript and has full type support.

It was primarily built for the Nimbus Client but can be used in any other project that requires Bluesky API integration.

Installation

# NPM
npm install tsky

# Yarn
yarn add tsky

# PNPM
pnpm add tsky

# Bun
bun add tsky

Usage

Use an identity & password login:

import { Tsky } from 'tsky';
import { CredentialManager } from '@atcute/client';

const manager = new CredentialManager({ service: 'https://bsky.social' });
await manager.login({
  identifier: 'alice.tsky.dev',
  password: 'password',
});

or the @atcute/oauth-browser-client:

import { Tsky } from 'tsky';
import { OAuthUserAgent, finalizeAuthorization } from '@atcute/oauth-browser-client';

// get a session as described at: https://github.com/mary-ext/atcute/tree/trunk/packages/oauth/browser-client

const manager = new OAuthUserAgent(session);

and then initialize the tsky client:

const tsky = new Tsky(manager);

// get the profile of a user
const profile = await tsky.bsky.profile('did:plc:giohuovwawlijq7jkuysq5dd');

console.log(profile.handle);

Links

Contributing

If you want to contribute to this project, please read the CONTRIBUTING.md file.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Bluesky API client for nimble apps and tools ☁️

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project