pl-api: works on docs
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
@ -4,6 +4,25 @@ A JavaScript library for interacting with Mastodon API-compatible servers, focus
|
||||
|
||||
`pl-api` attempts to abstract out the implementation details when supporting different backends, implementing the same features in different ways. It uses [Valibot](https://valibot.dev/) to ensure type safety and normalize API responses.
|
||||
|
||||
Example:
|
||||
```ts
|
||||
import { PlApiClient, type CreateApplicationParams } from 'pl-api';
|
||||
|
||||
const { ACCESS_TOKEN } = process.env;
|
||||
|
||||
const client = new PlApiClient('https://mastodon.example/', ACCESS_TOKEN, {
|
||||
fetchInstance: true,
|
||||
onInstanceFetchSuccess: () => console.log('Instance fetched'),
|
||||
});
|
||||
|
||||
await client.statuses.createStatus({
|
||||
status: 'Hello, world!',
|
||||
language: 'en',
|
||||
});
|
||||
```
|
||||
|
||||
Some sort of documentation is available on https://pl.mkljczk.pl/pl-api-docs
|
||||
|
||||
> This project should be considered unstable before the 1.0.0 release. I will not provide any changelog or information on breaking changes until then.
|
||||
|
||||
## Projects using `pl-api`
|
||||
|
||||
Reference in New Issue
Block a user