Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sanity/astro

Package Overview
Dependencies
Maintainers
37
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/astro

Official Sanity Astro integration

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
37
Created
Source

@sanity/astro

Official Sanity Astro integration

Installation

In your Astro project, run the following command to install the Sanity Astro integration

npx astro add @sanity/astro

Usage in Astro

Configure the integration in your astro.config.mjs file. The configuration options are the same as for @sanity/client.

import sanityIntegration from '@sanity/astro';
import { defineConfig } from 'astro/config';

// https://astro.build/config
export default defineConfig({
  integrations: [
    sanityIntegration({
      projectId: '3do82whm',
      dataset: "next",
      useCdn: true
    })
  ]
});

PortableText

We recommend using astro-portabletext to render your PortableText fields in Astro. See an example of this in apps/example/src/components/PortableText.astro, including using custom components to render custom blocks and annotations.

Presenting images

We recommend using @sanity/image-url to help you generate URLs for presenting Sanity images in your Astro app. See an example of this in apps/example/src/components/SanityImage.astro

Keywords

FAQs

Package last updated on 09 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc