Skip to content

Minimal JavaScript SMART Client (PKCE)

// Pseudocode outline for SMART-on-FHIR launch
const config = await fetch('/.well-known/smart-configuration').then(r => r.json());
// Redirect to authorisation endpoint with PKCE challenge
// After user login, exchange code for token at /token endpoint
// Use access token to call FHIR API

Adding a New App Card to EHR Launcher

  1. Edit ehr-config.json to add your app entry.
  2. Mount the updated config into the smart-launcher-ui container.
  3. Restart Docker Compose to apply changes.

Example Launch Link

http://localhost:81/launch?app=my-smart-app-client-id&patient=example-patient-id&iss=http://smart-launcher:8081/fhir

Troubleshooting

  • Check container logs for errors (docker-compose logs smart-launcher)
  • Verify all URLs and client IDs are correct
  • Use browser developer tools to inspect OAuth2 redirects and token exchanges

OHS Example

See the OHS example for a worked integration example and configuration snippets: OHS example.