Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jmandel/shlinker
https://github.com/jmandel/shlinker
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jmandel/shlinker
- Owner: jmandel
- Created: 2024-04-26T22:21:21.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-18T23:32:42.000Z (6 months ago)
- Last Synced: 2024-10-06T15:39:18.607Z (about 1 month ago)
- Language: TypeScript
- Size: 82 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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 })