protomapr/man/set_protomaps_key.Rd

34 lines
803 B
Text
Raw Permalink Normal View History

2026-03-06 15:46:39 +11:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/addProtomaps.R
\name{set_protomaps_key}
\alias{set_protomaps_key}
\title{Set Protomaps API key}
\usage{
set_protomaps_key(api_key)
}
\arguments{
\item{api_key}{Character. Your Protomaps API key.}
}
\value{
Invisibly returns the API key.
}
\description{
Convenience function to set your Protomaps API key for the current session.
The key is stored in the \code{PROTOMAPS_API_KEY} environment variable.
For persistent storage, add to your \code{.Renviron} file:
\code{PROTOMAPS_API_KEY=your-key-here}
Get a free API key at \url{https://protomaps.com/}.
}
\examples{
\dontrun{
set_protomaps_key("your-api-key-here")
# Now protomaps_url() will work without arguments
leaflet() \%>\%
addProtomaps(url = protomaps_url())
}
}