https://github.com/christophecvb/strapi-plugin-qr-code
A Strapi plugin to display generated QR Codes on the admin panel's ContentTypes.
https://github.com/christophecvb/strapi-plugin-qr-code
plugin qr-code strapi strapi-plugin
Last synced: 5 months ago
JSON representation
A Strapi plugin to display generated QR Codes on the admin panel's ContentTypes.
- Host: GitHub
- URL: https://github.com/christophecvb/strapi-plugin-qr-code
- Owner: ChristopheCVB
- License: mit
- Created: 2025-06-11T15:27:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-21T13:52:46.000Z (about 1 year ago)
- Last Synced: 2025-06-21T14:38:51.878Z (about 1 year ago)
- Topics: plugin, qr-code, strapi, strapi-plugin
- Language: TypeScript
- Homepage:
- Size: 1000 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
A plugin for [Strapi Headless CMS](https://github.com/strapi/strapi) that provides an easy way to show QR Codes in Strapi entities.
## Features
- Show QR Code to strapi entities on update form. This QR Code leads to computed text.
## Usage
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.
### Example Configuration
```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}`
},
},
{
uid: 'api::category.category',
computeValue: (uid, status, document) => {
return `My category is: ${document.name} - status: ${status} - edited: ${document.updatedDate}`
},
},
],
} satisfies QRCodeConfig,
}
})
```