To install this plugin, use the following command:
npm install sanity-qr-code-generator
To use this plugin, add it as a plugin in your
sanity.config.ts
(or .js) file, as shown in the example below:
import {defineConfig} from 'sanity'
import {QrCodeGenerator} from 'sanity-qr-code-generator'
export default defineConfig({
//..
plugins: [.., .., QrCodeGenerator()],
})
Then you can use 'qrCode' as custom type in your schemas.
defineField({
title: 'Generate your QR code',
name: 'qrCode',
type: 'qrCode',
})
This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.
See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.
Have fun ✌️