Make a new snoots Client.
The options to configure this client with.
Readonly
commentsControls for interacting with comments.
Readonly
meControls for interacting with the currently authorized user.
Readonly
postsControls for interacting with posts.
Readonly
subredditsControls for interacting with subreddits.
Readonly
usersControls for interacting with users.
Get the last-known rate limit status for this client.
The rate limit status is only updated when a request is made from this client. It will also get out of sync if there are multiple clients using the same authorization (and thus the same rate limit pool).
Static
fromCreate a client from an OAuth code.
Client or a subclass of Client.
The Client subclass. This is only used for typescript to work with subclasses, this is not actually a parameter.
The Client options.
The OAuth code.
The redirect URI. This must be the same as the uri given to makeAuthUrl.
A promise that resolves when the authorization is complete.
Static
makeMake an OAuth login url.
The ID of the Reddit app.
The scopes to authorize with.
The uri to redirect to after authorization.
Some arbitrary state that will be passed back upon authorization. This is used as a CSRF token to prevent various attacks.
Whether the auth should be temporary (expires after 1hr), or permanent.
The URL to direct the user to for authorization.
The main Client class. This is the primary way you will interact with snoots.
Every Client instance is fully independent, so you are free to create as many as you require.
Example: The most common way to use snoots is to make a client
Example: If you already have a refresh token from a previous session you can
use that as well.
Example: If you want to make requests not on behalf of a user, you can leave
out the
auth
key. See ClientOptions.auth for more details.Example: If you want to make completely unauthenticated requests, you can
leave out both the
auth
andcreds
keys. See ClientOptions.creds for more details and restrictions.