|
| 1 | +<p align="center"> |
| 2 | + <img src="https://raw.githubusercontent.com/tsky-dev/tsky/refs/heads/main/.github/assets/tsky-logo.png" width="200" height="200"> |
| 3 | +</p> |
| 4 | + |
| 5 | +<h1 align="center">tsky</h1> |
| 6 | + |
| 7 | +<p align="center"> |
| 8 | + A lightweight, fast, universal and typed Bluesky API wrapper for Apps & Bots. |
| 9 | +</p> |
| 10 | + |
| 11 | +## ⚠️ tsky is still in development and is not ready for production use |
| 12 | + |
| 13 | +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](CONTRIBUTING.md) file or join our [Discord Server](https://discord.gg/KPD7XPUZn3). |
| 14 | + |
| 15 | +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. |
| 16 | + |
| 17 | +It was primarily built for the [Nimbus Client](https://github.com/nimbus-town/nimbus) but can be used in any other project that requires Bluesky API integration. |
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +```bash |
| 22 | +# NPM |
| 23 | +npm install tsky |
| 24 | + |
| 25 | +# Yarn |
| 26 | +yarn add tsky |
| 27 | + |
| 28 | +# PNPM |
| 29 | +pnpm add tsky |
| 30 | + |
| 31 | +# Bun |
| 32 | +bun add tsky |
| 33 | +``` |
| 34 | + |
| 35 | +## Usage |
| 36 | + |
| 37 | +Using a Public Agent |
| 38 | + |
| 39 | +```ts |
| 40 | +import { createAgent } from '@tsky/client'; |
| 41 | + |
| 42 | +const agent = await createAgent({ |
| 43 | + options: { |
| 44 | + service: 'https://public.api.bsky.app', |
| 45 | + }, |
| 46 | +}); |
| 47 | + |
| 48 | +// Getting a user from their handle |
| 49 | +// First, we need to get the user's DID |
| 50 | +const did = await agent.resolveDIDFromHandle(handle); |
| 51 | +// Then, we can get the user's profile |
| 52 | +const profile = await agent.actor(did); |
| 53 | +``` |
| 54 | + |
| 55 | +Using an Authenticated Agent |
| 56 | + |
| 57 | +```ts |
| 58 | +import { createAgent } from '@tsky/client'; |
| 59 | + |
| 60 | +const agent = await createAgent({ |
| 61 | + credentials: { |
| 62 | + identifier: "handle", |
| 63 | + password: "password" |
| 64 | + } |
| 65 | +}); |
| 66 | + |
| 67 | +// Getting the profile of the authenticated user |
| 68 | +const user_profile = await agent.user.profile(); |
| 69 | +``` |
| 70 | + |
| 71 | +## Links |
| 72 | + |
| 73 | +- [📚 tsky Documentation](https://tsky.dev/) |
| 74 | +- [🦋 tsky on Bluesky](https://bsky.app/profile/tsky.dev) |
| 75 | +- [📣 tsky Discord Server](https://discord.gg/KPD7XPUZn3) |
| 76 | +- [🦋 Nimbus on Bluesky](https://bsky.app/profile/nimbus.town) |
| 77 | + |
| 78 | +## Contributing |
| 79 | + |
| 80 | +If you want to contribute to this project, please read the [CONTRIBUTING.md](CONTRIBUTING.md) file. |
| 81 | + |
| 82 | +## License |
| 83 | + |
| 84 | +This project is licensed under the MIT License - see the [LICENSE](https://github.com/tsky-dev/tsky/blob/main/LICENSE) file for details. |
0 commit comments