diff --git a/main.go b/main.go
index 6d931629ef40a58c49882b40be4f203a03e4dd4f..99092e735d966c3b44d5a61a7456f08e47a97fac 100644
--- a/main.go
+++ b/main.go
@@ -76,6 +76,7 @@ func buildViamAPI() string {
 	keysLen := len(keys)
 
 	result += "function ViamAPI() {\n" +
+		"    this.privateKey = \"\";\n" +
 		"    this.config = {\n" +
 		"        headers: {\n" +
 		"            'publicKey': '',\n" +
@@ -99,7 +100,16 @@ func buildViamAPI() string {
 		"    this.config.headers.publicKey = window.btoa(authenticationPublicKey);\n" +
 		"};\n\n"
 
-	result += "ViamAPI.prototype.getConfig = function() {\n" +
+	result += "ViamAPI.prototype.setPrivateKey = function(privateKey) {\n" +
+		"    this.privateKey = privateKey;\n" +
+		"};\n\n"
+
+	result += "ViamAPI.prototype.setPrivateKey = function(privateKey) {\n" +
+		"    this.privateKey = privateKey;\n" +
+		"};\n\n"
+
+	result += "this.generateNonce = function() {\n" +
+		"    var privateKey = config.privateKey;\n" +
 		"    return this.config;\n" +
 		"};\n\n"