Skip to content

Interactive Demo

This pen demonstrates the full workflow: configure SaltyKeys, generate a salted key in the console, then decode it.

This pen generates a salted key, then shows that changing the simulated pen ID causes getApiKey() to return null.

Configure SaltyKeys for a non-CodePen environment using a custom URL pattern.

If you want to test SaltyKeys.js without CodePen:

  1. Open any webpage in your browser
  2. Open Developer Tools → Console
  3. Paste the contents of SaltyKeys.js
  4. Override getPenId to return a fixed string:
    SaltyKeys.getPenId = () => 'test-id';
    const salted = SaltyKeys.generateSaltedKey('my-key');
    console.log(SaltyKeys.getApiKey(salted)); // → 'my-key'