Skip to content

Commit

Permalink
Adding documentation and updating sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
reshmakh committed May 12, 2022
1 parent 09ff575 commit e8c7776
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Medplum Demo Bots

This repo contains code for [Medplum Bots](https://docs.medplum.com/app/bots). Bots power many of the integrations you see in Medplum apps. You can view your deployed bots online on the [Medplum App](https://app.medplum.com).

Bots make heavy use of the [Medplum JS Client Library](https://docs.medplum.com/typedoc/core/index.html).

Change bot ID in here: https://github.com/medplum/medplum-demo-bots/blob/main/package.json

## Setup

To set up your bot deployment you will need to do the following:

* [Create a Bot](https://app.medplum.com/admin/project) on Medplum and note its `id`. (All Bots in your account can be found [here](https://app.medplum.com/Bot))
* Create a new typescript file (e.g. `my-bot.ts`) and copy the contents of `hello-world.ts` into your new file.
* With the `id` of the Bot `id` in hand, add a line to `package.json` in the `scripts` section like so.

```json
"deploy:my-bot": "medplum deploy-bot dist/my-bot.js <bot-id>"
```

* [Create an ClientApplication](https://app.medplum.com/ClientApplication/new) on Medplum. (All ClientApplications in your account can be found [here](https://app.medplum.com/ClientApplication))
* Create a .env file locally by copying `.env.example` and put the `ClientId` and `ClientSecret` from the `ClientApplication` into the file.
* (Optional) Create an [AccessPolicy]((https://app.medplum.com/AccessPolicy)) on Medplum that can only read/write Bots and add it to the Bot in the [admin panel](https://app.medplum.com/admin/project).

## Installation

To run and deploy your Bot do the following steps:

Install:

```bash
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"author": "Medplum <[email protected]>",
"license": "Apache-2.0",
"devDependencies": {
"@medplum/cli": "^0.9.2",
"@medplum/core": "^0.9.2",
"@medplum/fhirtypes": "^0.9.2",
"@medplum/cli": "^0.9.4",
"@medplum/core": "^0.9.4",
"@medplum/fhirtypes": "^0.9.4",
"@types/node": "^17.0.31",
"eslint": "8.14.0",
"eslint-config-prettier": "8.5.0",
Expand Down

0 comments on commit e8c7776

Please sign in to comment.