A Strapi plugin to display generated QR Codes on the admin panel's ContentTypes.
npm install strapi-plugin-qr-code
---

A plugin for Strapi Headless CMS that provides an easy way to show QR Codes in Strapi entities.
To configure the QR Code plugin, add your configuration to the plugin settings. The configuration consist of an array of contentTypes with their own computeValue function:
``typescript`
type Config = {
contentTypes: Array<{
uid: UID.ContentType
populate?: Array
computeValue: (
uid: UID.ContentType,
status: 'draft' | 'published',
document: Modules.Documents.Document
): string | Promise
}>,
};
This configuration allows you to define a computeValue for content-types associated. The plugin try to fetch the concerned entity and pass it to computeValue function in document parameters. The string output of the function is what is used to generate the QR Code.
`typescript
// config/plugins.ts
import type { Config as QRCodeConfig } from 'strapi-plugin-qr-code/dist/server/src/config'
export default () => ({
'qr-code': {
enabled: true,
config: {
contentTypes: [
{
uid: 'api::content.content',
computeValue: (uid, status, document) => {
return /${uid.split('.')[1]}?status=${status}&documentId=${document.documentId}My category is: ${document.name} - status: ${status} - edited: ${document.updatedDate}
},
},
{
uid: 'api::category.category',
computeValue: (uid, status, document) => {
return ``
},
},
],
} satisfies QRCodeConfig,
}
})