diff --git a/_develop/storage.md b/_develop/storage.md index c8523cb9..9d5116dd 100644 --- a/_develop/storage.md +++ b/_develop/storage.md @@ -20,10 +20,11 @@ The Blockstack Platform stores application data in the Gaia Storage System. Tran You use the UserSession.putFile ```JavaScript +var userSession = new UserSession() let options = { encrypt: false } - blockstack.UserSession.putFile("/hello.txt", "hello world!", options) + userSession.putFile("/hello.txt", "hello world!", options) .then(() => { // /hello.txt exists now, and has the contents "hello world!". }) @@ -34,11 +35,13 @@ let options = { You use the ```JavaScript +var userSession = new UserSession() + let options = { encrypt: true } - blockstack.UserSession.putFile("/message.txt", "Secret hello!", options) + userSession.putFile("/message.txt", "Secret hello!", options) .then(() => { // message.txt exists now, and has the contents "hello world!". }) @@ -49,11 +52,13 @@ You use the ```JavaScript +var userSession = new UserSession() + let options = { decrypt: false } - blockstack.UserSession.getFile("/hello.txt", options) + userSession.getFile("/hello.txt", options) .then((fileContents) => { // get the contents of the file /hello.txt assert(fileContents === "hello world!") @@ -65,11 +70,13 @@ You use the ```JavaScript +var userSession = new UserSession() + let options = { decrypt: true } - blockstack.UserSession.getFile("/message.txt", options) + userSession.getFile("/message.txt", options) .then((fileContents) => { // get & decrypt the contents of the file /message.txt assert(fileContents === "Secret hello!")