Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 561 Bytes

File metadata and controls

27 lines (18 loc) · 561 Bytes

posecode-share

Encodes and decodes .posecode documents to URL-safe share tokens: the distribution primitive behind Posecode playground permalinks and embeds. Pure, dependency-free.

Install

npm install posecode-share

Usage

import { buildShareHash, readShareHash } from "posecode-share";

const hash = buildShareHash(myPosecodeSource); // "#doc=…"
const link = `https://posecode.org/play${hash}`;

// On the receiving page:
const source = readShareHash(window.location.hash);

License

Apache-2.0