Create a magic link
Magic links let you authenticate patients and redirect them to a specific page — like a vitals scan — without requiring them to log in. This is useful when you’re integrating scans into your own app and want a seamless experience for patients.
Integration steps
Section titled “Integration steps”-
Create a patient
Section titled “Create a patient”Register the patient with their name and email. If a patient with the same email already exists, their record is updated by default.
const { data: patient } =await client.v1.core.patients.create({name: 'Jane Smith',email: 'jane@example.com',}) -
Build the scan URL
Section titled “Build the scan URL”Construct the URL for the scan page using your business alias and the link slug. You can find both in the Vitals dashboard or by calling
client.v1.vitals.links.list().const alias = process.env.UPVIO_BUSINESS_ALIASconst slug = 'your-link-slug'const scanUrl =`https://scan.upvio.com/${alias}/links/${slug}` -
Generate the magic link
Section titled “Generate the magic link”Create a magic link that authenticates the patient and redirects them to the scan URL:
const { data: magicLink } =await client.v1.core.patients.createMagicLink(patient.id,{ redirectUrl: scanUrl },)console.log(magicLink.url)// https://account.upvio.com/auth/magic?token=...Send
magicLink.urlto the patient via email, SMS, or display it in your app. When they open the link, they’re authenticated and taken straight to the scan.