1.0.0 • Published 3 years ago

curai-js v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

curai-js

The Curai Health embedded experience JavaScript library

Usage

For a full guide on how to use this library, please see our Quickstart Guide.

CDN (https://unpkg.com/)

Example:

<html>
  <head>
    <script crossorigin type="text/javascript" src="https://unpkg.com/curai-js"></script>
  </head>
  <body>
    <div id="”embedded-chat”" />
  </body>
  <script type="text/javascript">
    Curai.startChatSession(clientId, accessToken, { parentElement: ... })
      .then((frame) => {
        // A valid session has started and the frame element is returned
      })
      .catch((err) => {
        // An error has occurred
      });
  </script>
</html>

See examples/script-tag-example.html for more.

Development

Getting Setup

  1. yarn or yarn install

Start Developing

  1. Open examples/script-tag-example.html in your browser or w/ LiveServer

    • Make sure that the local script is loaded instead of the one hosted by unpkg
      <script type="text/javascript" src="../dist/index.js"></script>
  2. Run yarn start to have the curai-js module build on save

Connecting to the Curai frontend

  1. Run the frontend locally patient app guide
  2. In flask admin, go to the Partner table and use a partner with an API key.
    • Add a clientID to this entry (eg. "livingsalmon")
  3. Register a patient using the API
    • Using your API key, craft a request following the gateway docs
    • Grab the returned accessToken
  4. Inject your clientId and accessToken into the examples/script-tag-example.html file

After following these steps you should see the example page load into the patient app greeting your registered patient!

Publishing

  1. Login to Curai NPM account on local machine
  2. Run yarn publish

    unpkg is pretty fast, but it can take a few minutes for the new version to be available

1.0.0

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.3.1

3 years ago

0.1.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago