jamesmaa / node-private

login / register / etc endpoints, only useful if you have access your own reddit instance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@r/private

A module that provides utilities for when you own your own reddit install.

Snoode Enhancements

Login, Register, and Token Refresh

Usage

import APIOptions from '@r/api-client';
import { PrivateAPI } from '@r/private';

const myAppOptions = {
  ...APIOptions,
  clientSecret: 'my-client-secret'
  clientId: 'my-super-secret-app-id',
};

const token = await PrivateAPI.login(myAppOptions, username, password);
const newToken = await PrivateAPI.refreshToken(myAppOptions, token.refresh_token);

const token = await PrivateAPI.convertCookiesToAuthToken(myAppOptions, cookies.split(';'));

About

login / register / etc endpoints, only useful if you have access your own reddit instance

License:MIT License


Languages

Language:JavaScript 100.0%