Name: node-private
Owner: Reddit
Description: login / register / etc endpoints, only useful if you have access your own reddit instance
Created: 2016-04-25 21:38:43.0
Updated: 2018-03-04 13:05:16.0
Pushed: 2017-08-02 21:57:42.0
Homepage: null
Size: 48
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A module that provides utilities for when you own your own reddit install.
Login, Register, and Token Refresh
rt APIOptions from '@r/api-client';
rt { PrivateAPI } from '@r/private';
t myAppOptions = {
.APIOptions,
ientSecret: 'my-client-secret'
ientId: 'my-super-secret-app-id',
thEmailScope: false, // only supported for non-embedded apps
t token = await PrivateAPI.login(myAppOptions, username, password);
t newToken = await PrivateAPI.refreshToken(myAppOptions, token.refresh_token);
t token = await PrivateAPI.convertCookiesToAuthToken(myAppOptions, cookies.split(';'));