% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rsconnect.R
\name{vetiver_deploy_rsconnect}
\alias{vetiver_deploy_rsconnect}
\title{Deploy a vetiver model API to Posit Connect}
\usage{
vetiver_deploy_rsconnect(
  board,
  name,
  version = NULL,
  predict_args = list(),
  appTitle = glue::glue("{name} model API"),
  ...,
  additional_pkgs = character(0)
)
}
\arguments{
\item{board}{A pin board, created by \code{\link[pins:board_folder]{board_folder()}}, \code{\link[pins:board_connect]{board_connect()}},
\code{\link[pins:board_url]{board_url()}} or another \code{board_} function.}

\item{name}{Pin name.}

\item{version}{Retrieve a specific version of a pin. Use \code{\link[pins:pin_versions]{pin_versions()}} to
find out which versions are available and when they were created.}

\item{predict_args}{A list of optional arguments passed to \code{\link[=vetiver_api]{vetiver_api()}}
such as the prediction \code{type}.}

\item{appTitle}{The API title on Posit Connect. Use the default based on
\code{name}, or pass in your own title.}

\item{...}{Other arguments passed to \code{\link[rsconnect:deployApp]{rsconnect::deployApp()}} such as
\code{appName}, \code{account}, or \code{launch.browser}.}

\item{additional_pkgs}{Any additional R packages that need to be \strong{attached}
via \code{\link[=library]{library()}} to run your API, as a character vector.}
}
\value{
The deployment success (\code{TRUE} or \code{FALSE}), invisibly.
}
\description{
Use \code{vetiver_deploy_rsconnect()} to deploy a \code{\link[=vetiver_model]{vetiver_model()}} that has been
versioned and stored via \code{\link[=vetiver_pin_write]{vetiver_pin_write()}} as a Plumber API on \href{https://docs.posit.co/connect/}{Posit Connect}.
}
\details{
The two functions \code{vetiver_deploy_rsconnect()} and
\code{\link[=vetiver_create_rsconnect_bundle]{vetiver_create_rsconnect_bundle()}} are alternatives to each other, providing
different strategies for deploying a vetiver model API to Posit Connect.

When you first deploy to Connect, your API will only be accessible to you.
You can \href{https://docs.posit.co/connect/user/content-settings/#set-viewers}{change the access settings}
so others can also access the API. For all access settings other than
"Anyone - no login required", anyone querying your API (including you)
will need to pass authentication details with your API call,
\href{https://docs.posit.co/connect/user/vetiver/#predict-from-your-model-endpoint}{as shown in the Connect documentation}.
}
\examples{
\dontshow{if (rlang::is_installed("rsconnect")) withAutoprint(\{ # examplesIf}
library(pins)
b <- board_temp(versioned = TRUE)
cars_lm <- lm(mpg ~ ., data = mtcars)
v <- vetiver_model(cars_lm, "cars_linear")
vetiver_pin_write(b, v)

if (FALSE) {
## pass args for predicting:
vetiver_deploy_rsconnect(
    b,
    "user.name/cars_linear",
    predict_args = list(debug = TRUE)
)

## specify an account name through `...`:
vetiver_deploy_rsconnect(
    b,
    "user.name/cars_linear",
    account = "user.name"
)
}
\dontshow{\}) # examplesIf}
}
\seealso{
\code{\link[=vetiver_write_plumber]{vetiver_write_plumber()}}, \code{\link[=vetiver_create_rsconnect_bundle]{vetiver_create_rsconnect_bundle()}}
}
