External Dependancies for Bots
# support
c
I need to create a bot that leverages both the Medplum SDK and the Twilio SDK. Are there any examples of how to uses external modules in bots?
c
@reshma that looks like its just using types 🤔 does that require having the actual strip SDK in the deployed bundle?
r
You are right - bots use Lambda layers https://www.medplum.com/docs/bots/bot-lambda-layer - which loads in the dependencies. Let me track down what libraries are available.
r
Hi @Charlie from Imagine , you can find the dependencies packaged with the Bot layer here: https://github.com/medplum/medplum/blob/main/packages/bot-layer/package.json#L18-L24
For external SDKs, we have had users in the past configure their bundlers to inline external SDKs into their Bot code, but it can get a bit messy. We don't have an official example for that workflow
c
I opted to stand up our own API for this sort of thing
with express middleware to use an access token from medplum for auth
165 Views