% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/autosync-package.R
\docType{package}
\name{autosync-package}
\alias{autosync-package}
\alias{autosync}
\title{autosync: 'Automerge' Sync Server and Client}
\description{
A WebSocket-based implementation of the 'automerge-repo' synchronization
protocol used by 'sync.automerge.org'. Acts as a sync server, enabling 'R' to
serve as a synchronization hub for 'Automerge' clients in 'JavaScript',
'Rust', and other languages, and as a client for fetching, editing, and
synchronizing documents hosted on remote servers.
}
\section{Main Functions}{

\describe{
\item{\code{\link[=sync_server]{sync_server()}}}{Create a new sync server with \verb{$start()} and
\verb{$close()} methods}
}
}

\section{Document Management}{

\describe{
\item{\code{\link[=create_document]{create_document()}}}{Create a new document}
\item{\code{\link[=get_document]{get_document()}}}{Retrieve a document by ID}
\item{\code{\link[=list_documents]{list_documents()}}}{List all document IDs}
\item{\code{\link[=generate_document_id]{generate_document_id()}}}{Generate a new document ID}
}
}

\section{Protocol}{

The server implements the automerge-repo sync protocol over WebSockets.
Messages are CBOR-encoded and include:
\describe{
\item{join/peer}{Handshake messages for connection establishment}
\item{request/sync}{Document synchronization messages}
\item{ephemeral}{Transient messages forwarded without persistence}
\item{error}{Error notifications}
}
}

\section{Example}{

\preformatted{
# Create and start a server
server <- sync_server()
server$start()
server$url

# Stop when done
server$close()
}
}

\seealso{
Useful links:
\itemize{
  \item \url{https://posit-dev.github.io/autosync/}
  \item \url{https://github.com/posit-dev/autosync}
  \item Report bugs at \url{https://github.com/posit-dev/autosync/issues}
}

}
\author{
\strong{Maintainer}: Charlie Gao \email{charlie.gao@posit.co} (\href{https://orcid.org/0000-0002-0750-061X}{ORCID})

Authors:
\itemize{
  \item Charlie Gao \email{charlie.gao@posit.co} (\href{https://orcid.org/0000-0002-0750-061X}{ORCID})
}

Other contributors:
\itemize{
  \item Posit Software, PBC (\href{https://ror.org/03wc8by49}{ROR}) [copyright holder, funder]
}

}
