Skip to content

IvanSakhman/medplum-demo-bots

Repository files navigation

Medplum Demo Bots

This repo contains code for Medplum Bots. Bots power many of the integrations you see in Medplum apps. You can view your deployed bots online on the Medplum App.

Bots make heavy use of the Medplum JS Client Library.

Setup

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

  • Create a Bot on Medplum and note its id. (All Bots in your account can be found here)
  • 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.
"deploy:my-bot": "medplum deploy-bot dist/my-bot.js <bot-id>"
  • Create an ClientApplication on Medplum. (All ClientApplications in your account can be found here)
  • 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 on Medplum that can only read/write Bots and add it to the Bot in the admin panel.

Installation

To run and deploy your Bot do the following steps:

Install:

npm i

Build:

npm run build

Test:

npm t

Deploy one bot:

npm run deploy:hello-world

Publishing your Bot

Before your bot runs in production you will need to publish it. Publishing only works from the Medplum app.

  • Navigate to the Bots page
  • Go to the Editor tab
  • Click on the Publish button

After a few seconds your bot will be published and run in production.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.9%
  • Shell 0.1%