Changelog
Changelog
Section titled “Changelog”All notable changes to SaltyKeys.js are documented here.
This project follows Keep a Changelog conventions and uses Semantic Versioning.
1.2.0 — March 7, 2026
Section titled “1.2.0 — March 7, 2026”- Test suite (
test/SaltyKeys.test.js) — 30 tests using Node.js built-innode:test, zero extra dependencies "test"script inpackage.json(node --test test/SaltyKeys.test.js)"type": "module"inpackage.jsonfor native ESM support- In-page warning banner (
_showWarning()) displayed whengetPenId()cannot resolve a pen ID — covers both “pen not yet saved” and “not on CodePen” scenarios - Deduplication of warning banners via
#warnShownprivate Set
getApiKey()now correctly recovers API keys that contain:characters — previously the colon-split destructure would treat the second segment of the key as the pen ID; now the last three segments (nonce, timestamp, penId) are popped and the remainder is rejoinedurlPatternand hostname check extended to covercdpn.io(CodePen’s embed/short-link domain) alongsidecodepen.io
1.1.0 — March 2026
Section titled “1.1.0 — March 2026”- Astro + Starlight documentation site in
docs/ - CodePenButton component for live demos in documentation
- Vercel deployment configuration (
vercel.json) - Standard repository files:
CONTRIBUTING.md,SECURITY.md,CODE_OF_CONDUCT.md
1.0.0 — May 2025
Section titled “1.0.0 — May 2025”- Initial release of
SaltyKeys.js configure()— shallow-merge configuration updates forurlPattern,cacheEnabled, andenvironmentgetPenId()— extracts the CodePen pen ID fromwindow.location.hrefor a canonical<link>tag, with optional cachinggenerateSaltedKey(apiKey)— produces an obfuscated key using the pen ID, a timestamp, and a random nonce encoded in reversed Unicode-safe Base64getApiKey(saltedKey)— decodes a salted key and returns the original API key if the pen ID matches the current context_safeEncode/_safeDecode— Unicode-safe Base64 helpers built onencodeURIComponent+btoa/atob- Default URL pattern covers CodePen editor view, debug view, full-page view, and full embed grid view
- Private class field
#cachedPenIdfor caching the extracted pen ID