Skip to content

Vermonster/fhir-kit-smart-messenger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FHIRKit SMART Messenger

SMART Messaging implementation for the browser.

Usage

// Some setup
const urlParams = new URLSearchParams(window.location.search);
const targetOrigin = urlParams.get('smart_messaging_origin') || '*';
const targetWindow = window.opener || window.parent;

const payload = { resourceType: "Basic" };

// Create a messenger object and call send with a callback
const messenger = new SmartMessenger(targetWindow, targetOrigin);

messenger.send('scratchpad.create', payload, (event) => {
  console.log(event);
  // ...
});

CDN

Add a <script> tag with this src:

https://cdn.jsdelivr.net/gh/Vermonster/fhir-kit-smart-messenger@latest/dist/index.min.js

Background

https://github.com/smart-on-fhir/smart-web-messaging

Requirements

Works in IE10+, modern Chrome, Safari, Firefox.

Development

Clone the repo and then

% yarn install
% yarn build --watch
% yarn start

Then open http://localhost:3000 in your browser.

Releases

No releases published

Packages

No packages published