{"id":24167147,"url":"https://github.com/posit-dev/connectapi","last_synced_at":"2026-04-01T21:21:18.130Z","repository":{"id":45118764,"uuid":"167249814","full_name":"posit-dev/connectapi","owner":"posit-dev","description":"An R package for interacting with the RStudio Connect Server API","archived":false,"fork":false,"pushed_at":"2025-01-21T18:39:51.000Z","size":5736,"stargazers_count":46,"open_issues_count":59,"forks_count":26,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-01-23T08:35:59.746Z","etag":null,"topics":["api-client","package","rstats","rstudio-connect"],"latest_commit_sha":null,"homepage":"https://pkgs.rstudio.com/connectapi/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posit-dev.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-23T20:32:57.000Z","updated_at":"2025-01-14T21:13:03.000Z","dependencies_parsed_at":"2024-05-01T21:14:31.239Z","dependency_job_id":"b4027817-4d08-4a22-b769-4e899995a201","html_url":"https://github.com/posit-dev/connectapi","commit_stats":null,"previous_names":["posit-dev/connectapi","rstudio/connectapi"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fconnectapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fconnectapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fconnectapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fconnectapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posit-dev","download_url":"https://codeload.github.com/posit-dev/connectapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249530,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","package","rstats","rstudio-connect"],"created_at":"2025-01-12T21:03:44.152Z","updated_at":"2026-04-01T21:21:18.116Z","avatar_url":"https://github.com/posit-dev.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing)\n[![CRAN status](https://www.r-pkg.org/badges/version/connectapi)](https://cran.r-project.org/package=connectapi)\n[![Codecov test coverage](https://codecov.io/gh/posit-dev/connectapi/branch/main/graph/badge.svg)](https://app.codecov.io/gh/posit-dev/connectapi?branch=main)\n[![R-CMD-check](https://github.com/posit-dev/connectapi/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/posit-dev/connectapi/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\n# connectapi \u003cimg src='man/figures/logo.svg' align=\"right\" height=\"139\" /\u003e\n\nThis package provides an R client for the [Posit Connect Server\nAPI](https://docs.posit.co/connect/api/), as well as helpful functions that\nutilize the client.\nIt is designed to work with all supported versions of Connect, though some features may only be available to newer versions.\n\n## Installation\n\nTo install from CRAN:\n\n```r\ninstall.packages(\"connectapi\")\n```\n\nTo install the development version:\n\n```r\nremotes::install_github('posit-dev/connectapi')\n```\n\n## Client\n\nTo create a client:\n\n```{r, eval = FALSE}\nlibrary(connectapi)\nclient \u003c- connect(\n  server = \"https://connect.example.com\",\n  api_key = \"\u003cSUPER SECRET API KEY\u003e\"\n)\n```\n\nYou can also define the following environment variables (in a `.Renviron` file, for instance):\n\n```\nCONNECT_SERVER  = https://connect.example.com\nCONNECT_API_KEY = my-secret-api-key\n```\n\nThese environment variable values will be used automatically if defined in your R session.\n\n```{r, eval = FALSE}\nlibrary(connectapi)\nclient \u003c- connect()\n```\n\n## Getting Started\n\nOnce a client is defined, you can use it to interact with Posit Connect.\n\n### Exploring Data\n\nYou can use the `get_` methods to retrieve data from the Posit Connect server.\n\n```r\nlibrary(connectapi)\nclient \u003c- connect()\n\n# get data\nusers \u003c- get_users(client)\ngroups \u003c- get_groups(client)\nusage_shiny \u003c- get_usage_shiny(client)\nusage_static \u003c- get_usage_static(client)\nsome_content \u003c- get_content(client)\n\n# get all content\nall_content \u003c- get_content(client, limit = Inf)\n```\n\n### Deployment\n\nThe `rsconnect` package is usually used for deploying content to Connect.\nHowever, if you want to use programmatic deployment with the Posit Connect\nServer API, then these `connectapi` helpers should be useful!\n\n```{r, eval = FALSE}\nlibrary(connectapi)\nclient \u003c- connect()\n\n# deploying content\n# NOTE: a `manifest.json` should already exist from `rsconnect::writeManifest()`\n\nbundle \u003c- bundle_dir(\"./path/to/directory\")\ncontent \u003c- client %\u003e%\n  deploy(bundle, name = \"my-app-name\") %\u003e%\n  poll_task()\n\n# set an image for content\n\ncontent %\u003e%\n  set_thumbnail(\"./my/local/image.png\")\n\ncontent %\u003e%\n  set_thumbnail(\"http://url.example.com/image.png\")\n\n# set image and a vanity URL\n\ncontent %\u003e%\n  set_thumbnail(\"./my/local/image.png\") %\u003e%\n  set_vanity_url(\"/my-awesome-app\")\n\n# change access_type to \"anyone\"\n\ncontent$update(access_type = \"all\")\n\n# edit another piece of content\n\nclient %\u003e%\n  content_item(\"the-content-guid\") %\u003e%\n  set_vanity_url(\"/another-awesome-app\")\n\n# migrate content to another server\n\nclient_prod \u003c- connect(\n  server = \"prod.example.com\",\n  api_key = \"my-secret-key\"\n)\n\nprod_bnd \u003c- client %\u003e%\n  content_item(\"the-guid-to-promote\") %\u003e%\n  download_bundle()\n\nclient_prod %\u003e%\n  deploy(prod_bnd, title = \"Now in Production\") %\u003e%\n  set_vanity_url(\"/my-app\")\n\n# open a browser to the content item\nclient_prod %\u003e% browse_dashboard()\nclient_prod %\u003e% browse_solo()\n\n# open a browser to the docs\nclient_prod %\u003e% browse_api_docs()\n```\n\n## Troubleshooting and FAQ\n\n**Access Denied Errors?**\n\nThis is likely due to either (1) `Connect$server` or `Connect$api_key` being\ndefined improperly or (2) you do not have access to the Posit Connect cluster\nto do the operation in question\n\n**Warning about version numbers**\n\nWe test the package against a range of versions of Connect, as old as\n`2022.10.0`. If your Connect server is older than that, the\npackage may still work.\n\nWe strive to:\n\n- track the latest version of the Posit Connect API\n- add new features as they come available and have demand\n- maintain backwards compatibility\n\nThese priorities are sometimes at odds, and sometimes they create\ninconsistencies between versions as a result. To mitigate this, we recommend:\n\n- Track the version of `connectapi` in use for your applications by using `renv`\n- Test high value content that uses `connectapi` before updating `connectapi` or Posit Connect\n- Update Posit Connect to the latest version _first_ when an update to `connectapi` is needed\n\n**Error - Need to update Posit Connect**\n\nAs a helpful clarification for users, we have added error messages to API\nrequests when the version implemented in the package specifically introduces a\nbackwards incompatible dependency on older versions of Posit Connect.\n\nIf you get this error message, our recommendation would be:\n\n- Look at [`NEWS.md`](./NEWS.md) to find the moment the change was introduced\n- Downgrade `connectapi` to the previous version of the package\n- (Advanced) Use the \"blame\" feature on GitHub to track commits and find out when the error was introduced\n\nPlease feel free to open an Issue if you think there is a bug, or ask a\nfree-form question on [Posit\nCommunity](https://forum.posit.co/c/posit-professional-hosted/posit-connect/27)\n\n**Other ideas for FAQs or Common Issues?**\n\nPlease open an issue or PR! We would love to have your contribution!\n\n## Code of Conduct\n\nPlease note that the connectapi project is released with a [Contributor Code of\nConduct](https://posit-dev.github.io/connectapi/CODE_OF_CONDUCT.html). By\ncontributing to this project, you agree to abide by its terms.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fconnectapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposit-dev%2Fconnectapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fconnectapi/lists"}