client_as function

Set default client for the current session

Set default client for the current session

client_as() sets up the default client used by rtweet API calls with PKCE. See rtweet_user() to learn more about the three available authentication options.

client_as(client = NULL)

Arguments

  • client: One of the following options:

    • NULL, the default, will look for rtweet's "default" authentication which uses your personal default Twitter client. If it's not found, it will call client_setup_default() to set it up.
    • A string giving the name of a saved auth file made by client_save().
    • A client object created by rtweet_client().

Returns

Invisibly returns the previous authentication mechanism.

Examples

## Not run: # Use app auth for the remainder of this session: my_app <- rtweet_app() auth_as(my_app) # Switch back to the default user based auth client_as() client_list() ## End(Not run)

See Also

Other client: client_get(), client_has_default(), client_save()

  • Maintainer: Lluís Revilla Sancho
  • License: MIT + file LICENSE
  • Last published: 2024-02-24