{"_id":"5595b553f4437019002888fc","project":"550a379f635c660d00527fd8","user":"550a378e635c660d00527fd7","version":{"_id":"550ada9d921b7d0d00228876","forked_from":"550a3b2542fff40d00ae5ffb","project":"550a379f635c660d00527fd8","__v":3,"createdAt":"2015-03-19T14:18:05.245Z","releaseDate":"2015-03-19T14:18:05.245Z","categories":["550ada9d921b7d0d00228877","550ada9d921b7d0d00228878","550ada9d921b7d0d00228879","550ada9d921b7d0d0022887a","550ada9d921b7d0d0022887b","550ada9d921b7d0d0022887c","550ada9d921b7d0d0022887d","5523e61e71c0542100993493","55246f72ccc28a0d0062c560"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0.0"},"__v":2,"category":{"_id":"550ada9d921b7d0d00228878","version":"550ada9d921b7d0d00228876","__v":4,"pages":["550ada9e921b7d0d0022888c","550ada9e921b7d0d0022888d","550ada9e921b7d0d0022888e","550ada9e921b7d0d0022888f","55121961a575b32f007c79f1","55297f32b316811900149fac","5595b553f4437019002888fc"],"project":"550a379f635c660d00527fd8","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-03-19T02:45:48.278Z","from_sync":false,"order":2,"slug":"authentication","title":"Authentication"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-02T22:04:03.710Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":999,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"This will only work in browsers!\",\n  \"body\": \"This page is for those who wish to run a script within reddit's context (e.g. injecting Snoocore into reddit) to extend the current website (e.g. how [RES](http://redditenhancementsuite.com/) works)\"\n}\n[/block]\nBecause authentication is going to be handled within the context of the reddit website, there is no need to authenticate with OAuth.\n\nSimply use the option `useBrowserCookies: true` in the initial authentication.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var Snoocore = require('snoocore');\\n\\nvar reddit = new Snoocore({\\n    userAgent: 'myApp:::at:::0.0.1 /u/user',\\n    useBrowserCookies: true\\n});\\n\\n// We can now make calls!\\nreddit('/hot.json').get().then(function(result) {\\n    console.log(result); \\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"using-existing-browser-cookies","type":"basic","title":"Using Browser Cookies"}

Using Browser Cookies


[block:callout] { "type": "info", "title": "This will only work in browsers!", "body": "This page is for those who wish to run a script within reddit's context (e.g. injecting Snoocore into reddit) to extend the current website (e.g. how [RES](http://redditenhancementsuite.com/) works)" } [/block] Because authentication is going to be handled within the context of the reddit website, there is no need to authenticate with OAuth. Simply use the option `useBrowserCookies: true` in the initial authentication. [block:code] { "codes": [ { "code": "var Snoocore = require('snoocore');\n\nvar reddit = new Snoocore({\n userAgent: 'myApp@0.0.1 /u/user',\n useBrowserCookies: true\n});\n\n// We can now make calls!\nreddit('/hot.json').get().then(function(result) {\n console.log(result); \n});", "language": "javascript" } ] } [/block]