Skip to contents

This quickstart guide walks you through generating your first certificate of authenticity. By the end, you’ll have a PDF certificate ready for an artwork.

Prerequisites

Before starting, ensure:

  1. Environment variables are configured (database + CDN access)
  2. LaTeX is installed (tinytex::install_tinytex() if needed)
  3. You have valid artist and artwork UUIDs from the database
# Verify LaTeX is available
tinytex::is_tinytex()
#> [1] TRUE

Generate a Certificate in 3 Steps

Step 1: Load the Package

Step 2: Get Your UUIDs

You need the artist UUID and artwork UUID. These come from the Artalytics database:

# Example: Query artist by slug
artist_record <- artutils::get_artist_by_slug("jane-doe")
artist <- artist_record$artist_uuid

# Example: Get artwork from artist's portfolio
artworks <- artutils::get_artist_artworks(artist)
artwork <- artworks[1, art_uuid]

Step 3: Generate the Certificate

cert <- renderCertificate(
  artist = artist,
  artwork = artwork
)

That’s it! The certificate is generated in a temporary directory.

View Your Certificate

The function returns a data.table with certificate details:

cert
#>                            artist_uuid                             art_uuid
#> 1: 746b8207-xxxx-xxxx-xxxx-xxxxxxxxxxxx 99a61148-xxxx-xxxx-xxxx-xxxxxxxxxxxx
#>       cert_id template_id frame_id          created_utc
#> 1: 000-000-123           5       12 2024-01-15 10:30:00
#>                                                              path_pdf
#> 1: https://art-coa.nyc3.cdn.digitaloceanspaces.com/.../CERT-000-000-123.pdf

# Open the PDF (local temp path)
# browseURL(cert$path_pdf)

Save to Platform

To persist the certificate to the database and CDN:

cert <- renderCertificate(
  artist = artist,
  artwork = artwork,
  saveDB = TRUE, # Save record to database
  saveCDN = TRUE # Upload files to CDN
)

# Now accessible publicly at:
cert$path_pdf # PDF certificate
cert$path_jpeg # JPEG preview

Customize Template and Frame

Certificates use randomly selected templates and frames by default. To use specific designs:

cert <- renderCertificate(
  artist = artist,
  artwork = artwork,
  which_templ = 1, # Template design (1-9)
  which_frame = 5 # Frame style (1-20)
)

Common Issues

“LaTeX failed to compile”

Ensure TinyTeX is installed with required packages:

tinytex::install_tinytex()
tinytex::tlmgr_install(c("tex-gyre", "fontspec", "luaotfload"))

“outdir not empty”

The output directory must be empty. Let the function create a temp directory (default) or specify an empty one:

cert <- renderCertificate(
  artist = artist,
  artwork = artwork,
  outdir = tempfile() # Fresh temp directory
)

Database connection errors

Verify environment variables are set:

Sys.getenv("ART_PGHOST") # Should not be empty
artcore::check_env_database()

Next Steps