Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jmandel/shlinker


https://github.com/jmandel/shlinker

Last synced: 19 days ago
JSON representation

Awesome Lists containing this project

README

        

# SHLinker: SMART Health Links Processing Library

SHLinker helps web applications work with SMART Health Links and display them consistently. It provides functions to parse, retrieve, and render SHLinks, making it easy to integrate SHLink functionality into your projects.

## Key Features

- Parse SHLinks and extract relevant information
- Retrieve files associated with SHLinks
- Render SHLink widgets with customizable options
- Decrypt and handle different file types (FHIR, SMART Health Cards)
- TypeScript support for enhanced developer experience

## Static Example

If you don't want to use a build process, you can always download or link to our CSS and JavaScript files:

![image](https://github.com/jmandel/shlinker/assets/313089/b7fb7273-d23f-4c39-a292-ec7511c0302d)

```html




SHLinker Test




import * as shlink from "https://cdn.jsdelivr.net/npm/[email protected]/dist/shlinker.js";
// ^^ Or download and use a local copy

// pass a shl directly, or let the library parse it from window.location
const parsed = await shlink.parse("https://joshuamandel.com/cgm/#shlink:/eyJ1cmwiOiJodHRwczovL2pvc2h1YW1hbmRlbC5jb20vY2dtL3NobC8xMjBkYXlfYWdwX2J1bmRsZV91bmd1ZXNzYWJsZV9zaGxfaWQwMDAwMDAwIiwiZmxhZyI6IkxVIiwia2V5IjoiYWdwX29ic191bmd1ZXNzYWJsZV9yYW5kb21fa2V5MDAwMDAwMDAwMDAwMCIsImxhYmVsIjoiSm9zaCdzIENHTSBEYXRhIn0");
const retrieved = await shlink.retrieve(parsed)
const main = document.getElementById("main")
shlink.render(retrieved, main, { showDetails: true })