Quick Setup Check
Start by running meetup_sitrep()
to set up
authentication or check your authentication status:
meetup_sitrep()
#>
#> ── meetupr Situation Report ────────────────────────────────────────────────────
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#>
#> ── Active Authentication Method ──
#>
#> ✔ OAuth (CI Mode) - "Active"
#> ℹ Cached Token: None - run `get_self()`
#> ℹ CI environment detected
#>
#> ── Package Settings ──
#>
#> ℹ Debug Mode: Disabled
#> ℹ API endpoint: <https://api.meetup.com/gql-ext>
#>
#> ── API Connectivity Test ──
#>
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> ✔ API Connection: Working
#> ℹ Authenticated as: R-Ladies Global (ID: 251470805)
This function will show you:
- Which authentication method is active
- Whether your credentials are properly configured
- API connectivity status
- Setup instructions if authentication is missing
Authentication Methods
Authentication is required to access the Meetup API. When you first
install and load the meetupr
package, you can use built-in
credentials for basic access. You authenticate by running
meetup_auth()
, (or any querying function) which opens a
browser window for OAuth login. You provide consent for the app to use
your Meetup account to retrieve data.
meetupr supports two authentication methods:
OAuth Authentication (Interactive)
Best for interactive development, data exploration, and one-off analyses.
Setup:
# Authenticate interactively (opens browser)
meetup_auth()
# Check authentication status
meetup_auth_status()
The OAuth token is cached locally in your httr2 cache directory.
Token files follow the pattern: {hash}-token.rds.enc
CI/CD Authentication (Non-Interactive)
For automated workflows, you can set up token-based authentication:
1. Authenticate locally first:
This encodes your token as base64 and provides instructions for setting CI secrets. It will also store this information using the keyring package.
2. Set environment variables in your CI
-
meetupr:token
- Base64-encoded token (from step 1)
-
meetupr:token_file
- Token filename (e.g.,ae743e0-token.rds.enc
)
Variables Reference
Keyring Credentials
When using keyring (either locally or in CI), credentials follow the
format service:username
:
Keyring Key | Required | Purpose |
---|---|---|
meetupr:client_id |
No* | OAuth client ID |
meetupr:client_secret |
No* | OAuth client secret |
meetupr:token |
for CI | Base64-encoded OAuth token |
meetupr:token_file |
for CI | Token filename |
* Built-in credentials are used if not provided
Environment Variables
Variable | Required | Purpose |
---|---|---|
MEETUP_CLIENT_NAME |
No | OAuth client name (default: “meetupr”) |
MEETUPR_DEBUG |
No | Enable debug output (“1” = on) |
Note for GitHub Actions: When setting keyring credentials as environment variables in YAML, quote the names:
Setting Credentials using Keyring
Instead of using environment variables, you can securely store and
retrieve credentials using the system keyring with the
meetup_key_set()
and meetup_key_get()
functions.
Storing Credentials
# Store client ID and secret in keyring
meetup_key_set("client_id", "your_client_id")
meetup_key_set("client_secret", "your_secret")
If you don’t provide a value, you will be prompted to input it interactively.
Using Stored Credentials When authentication is needed, the meetupr package will automatically retrieve the stored credentials:
# Retrieve client ID and secret (used internally by meetupr)
client_id <- meetup_key_get("client_id")
client_secret <- meetup_key_get("client_secret")
Verification
After storing your credentials in the keyring, you can verify the setup:
meetup_sitrep()
#>
#> ── meetupr Situation Report ────────────────────────────────────────────────────
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#>
#> ── Active Authentication Method ──
#>
#> ✔ OAuth (CI Mode) - "Active"
#> ℹ Cached Token: None - run `get_self()`
#> ℹ CI environment detected
#>
#> ── Package Settings ──
#>
#> ℹ Debug Mode: Disabled
#> ℹ API endpoint: <https://api.meetup.com/gql-ext>
#>
#> ── API Connectivity Test ──
#>
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> ✔ API Connection: Working
#> ℹ Authenticated as: R-Ladies Global (ID: 251470805)
Basic Usage Examples
Get Group Information
group_info <- get_group("rladies-lagos")
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
str(group_info)
#> List of 13
#> $ id : chr "32612004"
#> $ name : chr "R-Ladies Lagos"
#> $ description : chr "R-Ladies is a world-wide organization to promote gender diversity in the R community.\nR-Ladies welcomes member"| __truncated__
#> $ urlname : chr "rladies-lagos"
#> $ link : chr "https://www.meetup.com/rladies-lagos"
#> $ location :List of 2
#> ..$ city : chr "Lagos"
#> ..$ country: chr "ng"
#> $ timezone : chr "Africa/Lagos"
#> $ created : POSIXct[1:1], format: "2019-08-16 08:45:21"
#> $ members : int 873
#> $ total_events: int 13
#> $ organizer :List of 2
#> ..$ id : chr "251470805"
#> ..$ name: chr "R-Ladies Global"
#> $ category :List of 2
#> ..$ id : chr "546"
#> ..$ name: chr "Technology"
#> $ photo_url : chr "https://secure-content.meetupstatic.com/images/classic-events/"
#> - attr(*, "class")= chr [1:2] "meetup_group" "list"
List Upcoming Events
events <- get_events("rladies-lagos")
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
head(events)
#> # A tibble: 6 × 23
#> id title event_url created_time status date_time duration
#> <chr> <chr> <chr> <dttm> <chr> <dttm> <chr>
#> 1 26415… satR… https://… 2019-08-20 11:54:50 PAST 2019-09-21 08:00:00 PT7H
#> 2 26675… Data… https://… 2019-11-26 17:00:29 PAST 2019-12-07 08:00:00 PT7H
#> 3 26780… Gett… https://… 2020-01-10 12:56:39 PAST 2020-02-22 08:00:00 PT7H
#> 4 28432… Data… https://… 2022-03-01 00:27:32 PAST 2022-03-26 13:00:00 PT2H
#> 5 28461… R La… https://… 2022-03-14 16:37:46 PAST 2022-05-07 15:00:00 PT1H
#> 6 29226… Wome… https://… 2023-03-15 19:29:08 PAST 2023-03-24 09:00:00 PT2H
#> # ℹ 16 more variables: description <chr>, group_id <chr>, group_name <chr>,
#> # group_urlname <chr>, venues_id <list>, venues_name <list>,
#> # venues_address <list>, venues_city <list>, venues_state <list>,
#> # venues_postal_code <list>, venues_country <list>, venues_lat <list>,
#> # venues_lon <list>, venues_venue_type <list>, rsvps_count <int>,
#> # featured_event_photo_url <chr>
Search for Groups
r_groups <- find_groups("R programming")
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
head(r_groups)
#> # A tibble: 6 × 14
#> id name urlname city state country lat lon memberships_count
#> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <int>
#> 1 38207702 Birmingha… bham-r… Birm… "AL" us 33.5 -86.8 2
#> 2 24890872 Warwick R… warwic… Cove… "43" gb 52.4 -1.56 918
#> 3 18574545 Johannesb… joburg… Joha… "" za -26.2 28.0 1549
#> 4 2906882 Birmingha… Birmin… Birm… "43" gb 52.5 -1.9 810
#> 5 23174619 R-Ladies … rladie… Sant… "" ar -36.6 -64.3 185
#> 6 21760043 R-Ladies … rladie… Buen… "" ar -34.6 -58.4 1960
#> # ℹ 5 more variables: founded_date <dttm>, timezone <chr>, join_mode <chr>,
#> # is_private <lgl>, membership_status <chr>
Debug Mode
Sometimes issues arise due to misconfiguration. Enabling debugging mode provides more information on what is sent to the API, i.e. the full graphql query. Enable debugging mode by setting system variable “MEETUPR_DEBUG” to 1 (0 or missing means no debugging):
local_meetupr_debug(1)
meetup_sitrep()
#>
#> ── meetupr Situation Report ────────────────────────────────────────────────────
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#>
#> ── Active Authentication Method ──
#>
#> ✔ OAuth (CI Mode) - "Active"
#> ℹ Cached Token: None - run `get_self()`
#> ℹ CI environment detected
#>
#> ── Package Settings ──
#>
#> ℹ Debug Mode: Enabled
#> ℹ API endpoint: <https://api.meetup.com/gql-ext>
#>
#> ── API Connectivity Test ──
#>
#> ℹ DEBUG: JSON to be sent:
#> {
#> "query": "query GetSelf{
#> self {
#> id
#> name
#> email
#> isOrganizer
#> isLeader
#> isMemberPlusSubscriber
#> isProOrganizer
#> adminProNetworks {
#> id
#> name
#> }
#> bio
#> city
#> country
#> state
#> lat
#> lon
#> startDate
#> preferredLocale
#> memberUrl
#>
#> }
#> }",
#> "variables": {}
#> }
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> ✖ API Connection: Failed - Failed to find matching request in active cassette, "meetupr-debug".
find_groups("R programming")
#> ℹ DEBUG: JSON to be sent:
#> {
#> "query": "query findGroups(
#> $query: String!
#> $cursor: String
#> $first: Int = 1000
#> $lat: Float! = 0.0
#> $lon: Float! = 0.0
#> $radius: Float = 100000000.0
#> ) {
#> groupSearch(
#> after: $cursor
#> first: $first
#> filter: {
#> query: $query
#> lat: $lat
#> lon: $lon
#> radius: $radius
#> }
#> ) {
#> pageInfo {
#> hasNextPage
#> endCursor
#> }
#> totalCount
#> edges {
#> node {
#> id
#> name
#> urlname
#> city
#> state
#> country
#> lat
#> lon
#> memberships {
#> totalCount
#> }
#> foundedDate
#> timezone
#> joinMode
#> isPrivate
#> membershipMetadata {
#> status
#> }
#> }
#> }
#> }
#> }",
#> "variables": {
#> "query": "R programming",
#> "first": 200
#> }
#> }
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> # A tibble: 200 × 14
#> id name urlname city state country lat lon memberships_count
#> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <int>
#> 1 38207702 Birming… bham-r… Birm… "AL" us 33.5 -86.8 2
#> 2 24890872 Warwick… warwic… Cove… "43" gb 52.4 -1.56 918
#> 3 18574545 Johanne… joburg… Joha… "" za -26.2 28.0 1549
#> 4 2906882 Birming… Birmin… Birm… "43" gb 52.5 -1.9 810
#> 5 23174619 R-Ladie… rladie… Sant… "" ar -36.6 -64.3 185
#> 6 21760043 R-Ladie… rladie… Buen… "" ar -34.6 -58.4 1960
#> 7 26517118 Salt La… slc-rug Salt… "UT" us 40.8 -112. 3041
#> 8 20443056 R-Ladie… rladie… Paris "" fr 48.9 2.34 1142
#> 9 37281989 Cape To… cape-t… Cape… "" za -33.9 18.5 108
#> 10 17428672 R Users… spotka… Wars… "" pl 52.3 21.0 2976
#> # ℹ 190 more rows
#> # ℹ 5 more variables: founded_date <dttm>, timezone <chr>, join_mode <chr>,
#> # is_private <lgl>, membership_status <chr>
to turn it off again, set it to 0 or unset it:
local_meetupr_debug(0)
meetup_sitrep()
#>
#> ── meetupr Situation Report ────────────────────────────────────────────────────
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#>
#> ── Active Authentication Method ──
#>
#> ✔ OAuth (CI Mode) - "Active"
#> ℹ Cached Token: None - run `get_self()`
#> ℹ CI environment detected
#>
#> ── Package Settings ──
#>
#> ℹ Debug Mode: Disabled
#> ℹ API endpoint: <https://api.meetup.com/gql-ext>
#>
#> ── API Connectivity Test ──
#>
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> ✖ API Connection: Failed - Failed to find matching request in active cassette, "meetupr-debug-off".
find_groups("R programming")
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> Warning in default_backend_auto(): Selecting 'env' backend. Secrets are stored
#> in environment variables
#> # A tibble: 200 × 14
#> id name urlname city state country lat lon memberships_count
#> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <int>
#> 1 38207702 Birming… bham-r… Birm… "AL" us 33.5 -86.8 2
#> 2 24890872 Warwick… warwic… Cove… "43" gb 52.4 -1.56 918
#> 3 18574545 Johanne… joburg… Joha… "" za -26.2 28.0 1549
#> 4 2906882 Birming… Birmin… Birm… "43" gb 52.5 -1.9 810
#> 5 23174619 R-Ladie… rladie… Sant… "" ar -36.6 -64.3 185
#> 6 21760043 R-Ladie… rladie… Buen… "" ar -34.6 -58.4 1960
#> 7 26517118 Salt La… slc-rug Salt… "UT" us 40.8 -112. 3041
#> 8 20443056 R-Ladie… rladie… Paris "" fr 48.9 2.34 1142
#> 9 37281989 Cape To… cape-t… Cape… "" za -33.9 18.5 108
#> 10 17428672 R Users… spotka… Wars… "" pl 52.3 21.0 2976
#> # ℹ 190 more rows
#> # ℹ 5 more variables: founded_date <dttm>, timezone <chr>, join_mode <chr>,
#> # is_private <lgl>, membership_status <chr>
Common Issues
Authentication Errors
Solution: Run meetup_sitrep()
to
diagnose authentication issues.
Next Steps
- For custom GraphQL queries: See GraphQL vignette`