% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/auth.R
\name{rtweet_user}
\alias{rtweet_user}
\alias{rtweet_bot}
\alias{rtweet_app}
\title{Authentication options}
\usage{
rtweet_user(api_key = NULL, api_secret = NULL)

rtweet_bot(api_key, api_secret, access_token, access_secret)

rtweet_app(bearer_token)
}
\arguments{
\item{api_key, api_secret}{Application API key and secret. These are
generally not required for \code{tweet_user()} since the defaults will use
the built-in rtweet app.}

\item{access_token, access_secret}{Access token and secret.}

\item{bearer_token}{App bearer token.}
}
\description{
There are three ways that you can authenticate with the Twitter API:
\itemize{
\item \code{rtweet_user()} interactively authenticates an existing Twitter user.
This form is most appropriate if you want rtweet to control your
Twitter account.
\item \code{rtweet_app()} authenticates as a Twitter application. An application can't
perform actions (i.e. it can't tweet) but otherwise has generally higher
rate limits (i.e. you can do more searches). See details
at \url{https://developer.twitter.com/en/docs/twitter-api/v1/rate-limits}.
This form is most appropriate if you are collecting data.
\item \code{rtweet_bot()} authenticates as bot that takes actions on behalf of an app.
This form is most appropriate if you want to create a Twitter account that
is run by a computer, rather than a human.
}

To use \code{rtweet_app()} or \code{rtweet_bot()} you will need to create your own
Twitter app following the instructions in \code{vignette("auth.Rmd")}.
\code{rtweet_user()} \emph{can be} used with your own app, but generally there is
no need to because it uses the Twitter app provided by rtweet.

Use \code{\link[=auth_as]{auth_as()}} to set the default auth mechanism for the current session,
and \code{\link[=auth_save]{auth_save()}} to save an auth mechanism for use in future sessions.
}
\details{
Authenticate methods to use the Twitter API.
}
\section{Security}{
All of the arguments to these functions are roughly equivalent to
passwords so should generally not be typed into the console (where they
the will be recorded in \code{.Rhistory}) or recorded in a script (which is
easy to accidentally share). Instead, call these functions without arguments
since the default behaviour is to use ask_pass that if possible uses
\code{\link[askpass:askpass]{askpass::askpass()}} to interactively safely prompt you for the values.
}

\examples{
\dontrun{
rtweet_user()
rtweet_bot()
rtweet_app()
}
}
\seealso{
Other authentication: 
\code{\link{auth_as}()},
\code{\link{auth_get}()},
\code{\link{auth_save}()},
\code{\link{auth_setup_default}()}
}
\concept{authentication}
