mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-13 07:23:08 +02:00
37 lines
807 B
Markdown
37 lines
807 B
Markdown
# misskey.js
|
|
|
|
## Install
|
|
coming soon
|
|
|
|
# Usage
|
|
## Authenticate
|
|
todo
|
|
|
|
## API request
|
|
都度インスタンスやトークンを指定する場合
|
|
``` ts
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
const meta = await Misskey.api.request('https://misskey.test', 'meta', { detail: true }, 'TOKEN');
|
|
```
|
|
|
|
最初にインスタンスやトークンを指定し、以後のリクエストでその情報を使いまわす場合
|
|
``` ts
|
|
import * as Misskey from 'misskey-js';
|
|
|
|
const cli = new Misskey.api.APIClient({
|
|
origin: 'https://misskey.test'
|
|
});
|
|
cli.i = { token: 'TOKEN' };
|
|
|
|
const meta = await cli.request('meta', { detail: true });
|
|
```
|
|
|
|
## Streaming
|
|
todo
|
|
|
|
---
|
|
|
|
<div align="center">
|
|
<a href="https://github.com/misskey-dev/misskey/blob/develop/CONTRIBUTING.md"><img src="./i-want-you.png" width="300"></a>
|
|
</div>
|