Skip to contents

Retrieves all active authentication tokens associated with a specific MotherDuck user account, returning them as a tidy tibble.

Usage

list_md_user_tokens(user_name, motherduck_token = "MOTHERDUCK_TOKEN")

Arguments

user_name

A character string specifying the MotherDuck user name whose tokens should be listed.

motherduck_token

Character. Either the name of an environment variable containing your MotherDuck access token (default "MOTHERDUCK_TOKEN") or the token itself.

Value

A tibble with two columns:

  • token_settings: metadata fields associated with each token.

  • token_values: corresponding values for those fields.

Details

This function queries the MotherDuck REST API endpoint https://api.motherduck.com/v1/users/{user_name}/tokens to list the tokens available for the specified user.

It uses the provided or environment-resolved motherduck_token for authorization. If motherduck_token is not explicitly provided, the function attempts to resolve it from the MOTHERDUCK_TOKEN environment variable The current authenticated user is displayed via show_current_user() for verification.

Examples

if (FALSE) { # \dontrun{
# List tokens for a specific user
tokens_tbl <- list_md_user_tokens(user_name = "alejandro_hagan")
print(tokens_tbl)
} # }