Hosted backend

Sanity is powered by a secure and scalable real-time database.

An iconic face being represented on a multitude of services and devices

Apps, not ops

Focus on building business value, not running operations.

Cloud platform icon

Cloud based

  • Hosted and fully managed
  • Auto scaling backends
Icon implying ease of use

Durable and reliable

  • Continuous DB backups with millisecond point in time recovery
  • Versioned asset backups
  • Isolated offsite backups
Icon of a lock implying security

Secure

  • All staff with physical access background vetted
  • Data encrypted at rest and in transit
  • APIs are TLS / SSL only
Icon implying performance

Performant

  • Optimized backend
  • Global load balancing with geo-routing
  • Edge cached assets
  • Geo-routed API cache
Icon of concentric circles implying edge caching infrastructure

Global CDN

  • Distributed & Redundant infrastructure
  • Geographically distributed

Read the getting started guide

Powerful Query Language

GROQ - Graph Oriented Query Language

Ask for exactly the information your application needs. Join together information from several sets of documents. Stitch together a very specific response the exact fields you need.

  • Follow references
  • Relational joins on key-value data
  • Get exactly the data structures you need by reprojecting attributes
  • Bundle multiple queries in the same request and get it all cached.
  • Query on structured block text

Everything

*

Movies released after 1979

*[_type == 'movie' && releaseYear > 1979]

… ordered by release year and only certain fields

*[_type == 'movie' && releaseYear >= 1979]
  | order(releaseYear) {
    _id, title, releaseYear
  }

Get actors and join in arrays of the titles of the movies they played in

*[_type == "person"]{
  _id, name,
  "movies":
    *[
      _type == "movie"
      && references(^._id)
    ].title
}

Read more about our Graph Oriented Query Language (GROQ)

Drawing of an iconic face appearing on lots of different devices

Real world, real time

Unfortunately the world happens all at once

Systems should respond to events as they unfold. Sanity is therefore built as a real-time architecture from the bottom-up.

Real-time

  • Patch-based updates
  • Transactional writes
  • Full revision history
  • Configurable consistency
  • Diff-match-patch for conflict free collaboration on block text

Get notified

  • Install webhooks
  • Listeners: Get streaming updates to queries
  • Hundreds of thousands of clients to listeners

Enterprise comforts

Sanity is Enterprise ready

An illustration of a business GNU
  • Handle millions of densely connected documents
  • Connect hundreds of thousands of real-time listeners
  • Single-sign-on (SSO) / Third party login integration
  • Free form security rules
  • Geographically cached endpoints
  • Service Level Agreement (SLA) available

Contact sales

Command Line Goodness

Sanity ships with a command line interface that makes it easy to create new projects and set up, import and tear down datasets.

Get started

npm install -g @sanity/cli && sanity init

Create and run new project

sanity init && sanity start

Create a new dataset

sanity dataset create myDataset

Export a dataset and associated assets

sanity dataset export myDataset

Install a webhook

sanity hook create myHook myDataset https://myCallbackURL

Query, slice and color it prettily

sanity documents query '*[_type == "movie"][0...5]' --pretty

Import your document

sanity import myJSON.json myDataset

Import reads new-line delimited JSON (NDJSON). It will very happily import your image assets both on local disk and from URLs. Afterwards references between objects will be made strong to ensure integrity. :tada:

Get the title, and have a cow say it

sanity documents get myDocId | jq .title | cowsay

Read the CLI documentation

Icon of image being cropped

Image pipeline

Deliver and transform images for any device

Sanity allows you to upload 268 megapixel archival originals. A flexible image pipeline will resize, crop and reformat on the way to clients. Set image hot-spots to recrop for any aspect ratio.

  • Store archival grade originals
  • Hot-spots: Automatically crop for different aspect-ratios
  • JPG, PNG & TIFF support. GIF too (kittehs!).
  • Pass-through for SVG
  • HTTP2 CDN
<img
  src={
    urlFor(mysteryPerson.mugshot)
    .width(200)
    .height(500)
    .blur(50)
    .url()
  }
/>

Read more about the Image URL Builder Client or the image URLs