🔗 DistBoard @hugoalh ● GitHub ● JSR ● NPM
An ECMAScript module to provide an easier and simplified method for encrypt GitHub secrets.
- Support multiple implementations:
- LibSodium: Default; Recommended by GitHub; Bad compatibility with bundler or compiler.
- TweetSodium: Originally created by GitHub but deprecated and unmaintained (Repository), currently maintain here; Good compatibility with bundler or compiler.
Any runtime which support ECMAScript should able to use this; These runtimes are officially supported:
This does not request any runtime permission.
| Type | Name | Path | Description |
|---|---|---|---|
| API | . |
./mod.ts |
Default (LibSodium). |
| API | ./libsodium |
./libsodium.ts |
LibSodium. |
| API | ./tweetsodium |
./tweetsodium.ts |
TweetSodium. |
| CLI | ./cli |
N/A | Default (LibSodium). |
| CLI | ./libsodium/cli |
./libsodium/cli.ts |
LibSodium. |
| CLI | ./tweetsodium/cli |
./tweetsodium/cli.ts |
TweetSodium. |
Note
- Different runtimes have vary support for the entrypoints, visit the runtime documentation for more information.
- These are not part of the public APIs hence should not be used:
- Benchmark/Test file (e.g.:
example.bench.ts,example.test.ts). - Entrypoint name or path include any underscore prefix (e.g.:
_example.ts,foo/_example.ts). - Identifier/Namespace/Symbol include any underscore prefix (e.g.:
_example,Foo._example).
- Benchmark/Test file (e.g.:
-
class GitHubSodiumSealer { constructor(publicKey: string); encrypt(value: string): string; }
Note
- For the full or prettier documentation, can visit via:
-
ghs $PublicKey $SecretValue
-
ghs-ls $PublicKey $SecretValue
-
ghs-ts $PublicKey $SecretValue
-
new GitHubSodiumSealer("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234").encrypt("plain-text-secret");
-
ghs '2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234' 'plain-text-secret'