update deltachat-jsonrpc readme

This commit is contained in:
Simon Laux
2024-11-02 14:52:40 +01:00
committed by Simon Laux
parent 78bac6021f
commit c4d849a502

View File

@@ -24,6 +24,21 @@ npm run build
The JavaScript client is [published on NPM](https://www.npmjs.com/package/@deltachat/jsonrpc-client).
###### Usage
```typescript
import { startDeltaChat } from "@deltachat/stdio-rpc-server";
import { C } from "@deltachat/jsonrpc-client";
const dc = await startDeltaChat("deltachat-data");
console.log(await dc.rpc.getSystemInfo());
const accounts = await dc.rpc.getAllAccounts()
console.log('accounts', accounts)
dc.close()
```
##### Generate TypeScript/JavaScript documentation
A script is included to build autogenerated documentation, which includes all RPC methods:
```sh
cd typescript