You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Does install_bitbucket work with (new, required) API tokens with scopes? #844
App passwords has been replaced by API tokens. As of September 9, 2025, app passwords can no longer be created. It's required to use API tokens with scopes instead. All existing app passwords will be disabled on June 9, 2026.
I used to install (private) packages from Bitbucket using devtools::install_bitbucket with the environment variables BITBUCKET_USER (my username) and BITBUCKET_PASSWORD (a App password) filled in. Now that it's no longer possible to create new App passwords and they will stop working in a few months what are we supposed to use?
Does install_bitbucket already work with API tokens with scopes? Do I just replace my App password with a API token with scopes in the BITBUCKET_PASSWORD variable or is there more to it?
Sys.setenv(BITBUCKET_USER='foo')
Sys.setenv(BITBUCKET_PASSWORD='App password')
devtools::install_bitbucket(repo="bar/r-helpers")
# works
Sys.setenv(BITBUCKET_USER='foo')
Sys.setenv(BITBUCKET_PASSWORD='API token with scopes')
devtools::install_bitbucket(repo="bar/r-helpers")
# does not work## Error: Failed to install 'unknown package' from Bitbucket:# cannot open URL 'https://api.bitbucket.org/2.0/repositories/bar/r-helpers/src/HEAD/DESCRIPTION'
Unfortunately, imho, my work also uses Atlassian products including Bitbucket. I got this to work by setting auth_user to my Bitbucket email and BITBUCKET_PASSWORD to an API token with the following scopes:
Unfortunately using ref to select a particular branch like feature/new doesn't work and results in the same error you see. It works with main but I think - not sure - the slash in the branch name throws off the API? I worked around that by having a little helper function that converts the ref to a commit id and that works.
An API token with the scopes above also worked for me, but I needed to change Sys.setenv(BITBUCKET_USER = 'username') to Sys.setenv(BITBUCKET_USER = 'email-address'). No need to set auth_user = "me@email.com" in the install_bitbucket call.
Activity
tersmitten commentedon Feb 3, 2026
tersmitten commentedon Mar 13, 2026
I'm I the only one using Bitbucket, or is this project dead?
tstev commentedon Mar 26, 2026
Hello Mischa!
Unfortunately, imho, my work also uses Atlassian products including Bitbucket. I got this to work by setting
auth_userto my Bitbucket email andBITBUCKET_PASSWORDto an API token with the following scopes:read:respository:bitbucketwrite:respository:bitbucketread:pullrequest:bitbucketwrite:pullrequest:bitbucketSo this work for me again using remotes:
Unfortunately using
refto select a particular branch likefeature/newdoesn't work and results in the same error you see. It works withmainbut I think - not sure - the slash in the branch name throws off the API? I worked around that by having a little helper function that converts therefto a commit id and that works.Something along the lines of:
Hopefully this works for you too!
tersmitten commentedon Mar 26, 2026
Thanks for adding your findings, I'll check if I can get it working like this too.
tersmitten commentedon Apr 27, 2026
An API token with the scopes above also worked for me, but I needed to change
Sys.setenv(BITBUCKET_USER = 'username')toSys.setenv(BITBUCKET_USER = 'email-address'). No need to setauth_user = "me@email.com"in theinstall_bitbucketcall.tersmitten commentedon Apr 27, 2026