Launcher for SMART apps
Make sure you have Git
and NodeJS
16 or higher, and then run:
git clone https://github.com/smart-on-fhir/smart-launcher.git
cd smart-launcher
npm i
You can use existing NPM scripts from within the project folder for common tasks:
npm start
Note that this will fail until you create a .env
file with some required settings. Minimal example (only the required settings):
FHIR_SERVER_R2="https://r2.smarthealthit.org"
FHIR_SERVER_R3="https://r3.smarthealthit.org"
FHIR_SERVER_R4="https://r4.smarthealthit.org"
PICKER_CONFIG_R2="r2"
PICKER_CONFIG_R3="r3"
PICKER_CONFIG_R4="r4"
To run the tests execute
npm test
# or this to also generate a coverage report
npm run test:cover
If you want to modify something run
npm run dev
This will watch for changes and restart the server automatically. It will also run the tests on every change.
To generate new private and public keys make sure you have openssl
(comes pre-installed on Mac), cd
to the project root and execute:
npm run cert
Then re-start the server and it will use the new keys.
People often use https://jwt.io/ to generate and validate tokens. However, it seems that the RS256 signature verification feature expects you to paste x.509
formatted public key or certificate and does not work with PEM-encoded PKCS#1 public keys. For that reason, if you want to manually verify your token at https://jwt.io/, you will need to provide the original x.509 version of the public key that you can find at the /public_key
endpoint of the server.
docker run -t -p 9009:80 smartonfhir/smart-launcher:latest