aboutsummaryrefslogtreecommitdiffstats
path: root/library/sodium-plus/browser.js
diff options
context:
space:
mode:
Diffstat (limited to 'library/sodium-plus/browser.js')
-rw-r--r--library/sodium-plus/browser.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/library/sodium-plus/browser.js b/library/sodium-plus/browser.js
new file mode 100644
index 000000000..8a413caf8
--- /dev/null
+++ b/library/sodium-plus/browser.js
@@ -0,0 +1,25 @@
+const {
+ CryptographyKey,
+ Ed25519PublicKey,
+ Ed25519SecretKey,
+ SodiumError,
+ SodiumPlus,
+ SodiumPolyfill,
+ SodiumUtil,
+ X25519PublicKey,
+ X25519SecretKey
+} = require('./index');
+
+// Load dependencies into window
+(async function(){
+ window.CryptographyKey = CryptographyKey;
+ window.Ed25519PublicKey = Ed25519PublicKey;
+ window.Ed25519SecretKey = Ed25519SecretKey;
+ window.SodiumError = SodiumError;
+ window.SodiumPlus = SodiumPlus;
+ window.SodiumPolyfill = SodiumPolyfill;
+ window.SodiumUtil = SodiumUtil;
+ window.X25519PublicKey = X25519PublicKey;
+ window.X25519SecretKey = X25519SecretKey;
+ window.sodium = await SodiumPlus.auto();
+})();