From c4d849a50279f391e0288002d589fe79fcd6f82e Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Sat, 2 Nov 2024 14:52:40 +0100 Subject: [PATCH] update deltachat-jsonrpc readme --- deltachat-jsonrpc/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/deltachat-jsonrpc/README.md b/deltachat-jsonrpc/README.md index fc02bd496..6554bcdd8 100644 --- a/deltachat-jsonrpc/README.md +++ b/deltachat-jsonrpc/README.md @@ -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