Documentation Index
Fetch the complete documentation index at: https://docs.metriport.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Metriport provides embeddable views that let your users access Metriport functionality from inside your application. You can open an embedded view in one of two ways:- Redirect: Send the user from your application to the Metriport embedded app URL.
- Iframe: Render the Metriport embedded app inside a page in your application.
- Patient View: Display a patient’s medical data.
- Transitions of Care (TCM): Monitor patient admissions, transfers, and discharges.
How embedding works
To load an embedded Metriport view:- Generate an embed token from your backend.
- Build the embedded app URL for the view you want to show.
- Include the embed token in the URL as the
access_token. - Redirect the user to that URL or render the URL in an iframe.
Generate an embed token
Create an embed token using the Create Embed Token endpoint.id
Environments
Use the embedded app URL that matches the environment where you generated the embed token.| Environment | Embedded app base URL |
|---|---|
| Production | https://ehr.metriport.com/embed/app |
| Sandbox | https://ehr.sandbox.metriport.com/embed/app |
Patient View
Use the Patient View to display a patient’s medical data inside your application.URL format
{patientId}with the ID of the patient to display.{token}with the embed token generated by your backend.
Redirect example
Use a redirect when you want to send the user from your application to the embedded Metriport page.Redirect
window.location.href = embedUrl navigates the browser to the embedded Metriport URL.
Iframe example
Use an iframe when you want to render the embedded Metriport view directly inside a page in your application.Iframe
src should be the embedded app URL for the view you want to render.
Transitions of Care (TCM)
Use the Transitions of Care view to monitor patient admissions, transfers, and discharges.URL format
{token} with the embed token generated by your backend.
Redirect example
Use a redirect when you want to send the user from your application to the embedded Metriport page.Redirect
Iframe example
Use an iframe when you want to render the embedded Metriport view directly inside a page in your application.Iframe
Security considerations
- Generate tokens server-side: Embed tokens require your Metriport API key, so they should be created by your backend.
- Do not expose your API key: Never include your Metriport API key in frontend code, mobile apps, or publicly accessible files.
- Use short token expirations: Embed tokens can expire after up to 10 hours, but shorter durations reduce risk.
- Use the correct environment: Sandbox tokens should only be used with sandbox URLs, and production tokens should only be used with production URLs.

