Safely Access the RStudio API
Overview
Access the RStudio API (if available) and provide informative error messages when it's not.
getDelegatedAzureToken()gains anasargument. Withas = "AzureToken", the token is returned as an R6 object compatible with theAzureTokenclass from theAzureAuthpackage, so it can be passed directly to packages likeAzureGraphandMicrosoft365R. (rstudio/rstudio#17619)getDelegatedAzureToken()now returns the same token shape in all IDEs: the relativeexpires_infield is converted to an absoluteexpires_attimestamp, matching what RStudio sessions already returned.getMode()no longer fails on very old versions of RStudio that lack the internal.rs.isDesktop()helper. In that case, it now falls back toversionInfo()$mode, which has been available since RStudio 0.97.124. (#326)- Added
showEditSuggestion()for displaying edit suggestions in the RStudio editor. The function takes a document range and suggested replacement text, allowing RStudio to present a visual diff that users can accept or dismiss.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK12 OK2026-04-27
Show 2 earlier changesHide 2 earlier changes
- NOTE13 OK, 1 NOTE2026-03-30
- OK14 OK2026-03-10
Documentation
- Help pages
- 101
- Examples that run
- 14%4 run in a plain check · 25 never run
- Exported functions with examples
- 29%
- Documented parameters
- 100%
- Return-value docs
- 33%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 85%
- Median days to close, 50 most recently updated closed issues
- 12
- Median days to close, 50 most recently updated closed PRs
- 1
PRs over time
Commits over time
Commit identities over time
9 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/rstudio/rstudioapi on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-06-11 · The repository has a site deploy workflow
pkgdown site last built 2026-06-11
Show all practicesHide 1 practice
Dependencies
Installing rstudioapi adds no packages beyond those that come with R.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 239 more dependents and 220 packages that suggest it on CRAN ↗
Code & Tests
People & History
Previously maintained by JJ Allaire (0.2 to 0.8) and Hadley Wickham (0.1).
Pick two releases to compare their code metrics.
- 0.19.0Latest
- RR 4.6.0 released · 2026-04-24
- 0.18.02026-01-16 · diff ↗ ·
added 5 exports
findOAuthIntegration, getIdentityToken, getOAuthCredentials, getOAuthIntegration, getOAuthIntegrations - RR 4.5.0 released · 2025-04-11
- 0.17.12024-10-23 · diff ↗
- 0.17.0
- RR 4.4.0 released · 2024-04-24
- 0.16.02024-03-24 · diff ↗ ·
added 5 exports
isBackgroundJob, isWorkbenchJob, jobGetState, jobList, setGhostText - 0.15.0
- RR 4.3.0 released · 2023-04-21
- 0.142022-08-23 · diff ↗ ·
added 5 exports
documentOpen, isJob, registerCommandCallback, registerCommandStreamCallback, unregisterCommandCallback - RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 0.132020-11-12 · diff ↗
- 0.122020-11-11 · diff ↗ ·
added 7 exports
documentId, documentPath, filesPaneNavigate, registerChunkCallback, selectionGet, selectionSet, unregisterChunkCallback - RR 4.0.0 released · 2020-04-24
Show 18 earlier eventsHide 18 earlier events
- 0.112020-02-08 · diff ↗ ·
added 7 exports
bugReport, getRStudioPackageDependencies, highlightUi, readRStudioPreference, systemUsername, userIdentity, writeRStudioPreference - RR 3.6.0 released · 2019-04-26
- 0.102019-03-19 · diff ↗ ·
added 15 exports
documentClose, executeCommand, launcherAvailable, launcherConfig, launcherContainer, launcherControlJob, launcherGetInfo, launcherGetJob, launcherGetJobs, launcherHostMount, launcherNfsMount, launcherPlacementConstraint, launcherResourceLimit, launcherSubmitJob, launcherSubmitR - 0.9.02019-01-09 · diff ↗ ·
added 12 exports
dictionariesPath, jobAdd, jobAddOutput, jobAddProgress, jobRemove, jobRunScript, jobSetProgress, jobSetState, jobSetStatus, removeTheme, translateLocalUrl, userDictionariesPath - 0.82018-10-02 · diff ↗ ·
added 10 exports
addTheme, applyTheme, askForSecret, buildToolsCheck, buildToolsExec, buildToolsInstall, convertTheme, documentNew, getThemes, previewSql - RR 3.5.0 released · 2018-04-23
- 0.72017-09-07 · diff ↗ ·
added 32 exports
createProjectTemplate, documentSave, documentSaveAll, getPersistentValue, getThemeInfo, hasColorConsole, initializeProject, openProject, readPreference, restartSession, savePlotAsImage, selectDirectory, selectFile, setPersistentValue, showDialog, showPrompt, showQuestion, terminalActivate, terminalBuffer, terminalBusy, terminalClear, terminalContext, terminalCreate, terminalExecute, terminalExitCode, terminalKill, terminalList, terminalRunning, terminalSend, terminalVisible and 2 more - RR 3.4.0 released · 2017-04-21
- 0.62016-06-27 · diff ↗ ·
added 6 exports
getConsoleEditorContext, getSourceEditorContext, primary_selection, sendToConsole, setCursorPosition, setSelectionRanges - RR 3.3.0 released · 2016-05-03
- 0.5
- 0.4.02015-12-09 · diff ↗ ·
added 11 exports
as.document_position, as.document_range, document_position, document_range, getActiveDocumentContext, insertText, is.document_position, is.document_range, modifyRange, navigateToFile, setDocumentContents - RR 3.2.0 released · 2015-04-16
- 0.3.1
- 0.2
- RR 3.1.0 released · 2014-04-10
- 0.12014-03-27
- RR 3.0.0 released · 2013-04-03
Package metadata
- First published
- 2014-03-27
- Total releases
- 20 / 12 yrs
- License
- MIT + file LICENSE OSI
- Download size
- 128 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("rstudioapi")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.