unique-link-qrcode
v0.1.3
Published
A strapi custom field to input unique string and display link and qr-code
Maintainers
Readme
Unique Link QRCode Plugin for Strapi
A Strapi custom field plugin that generates a unique link and QR code from a unique ID input.
Features
- Input a unique ID string
- Automatically generates a full URL by combining the ID with a configurable base URL
- Display the generated link with a copy-to-clipboard button
- Display a QR code that can be scanned to access the link
- Configurable base URL (default:
https://example.com) - Optional regex validation for unique IDs
Installation
yarn add unique-link-qrcodeUsage
1. Enable the Plugin
Add the plugin to your Strapi project's config/plugins.js (or config/plugins.ts):
module.exports = {
'unique-link-qrcode': {
enabled: true,
},
};2. Add Custom Field to Content Type
- Go to Content-Type Builder in your Strapi admin panel
- Select or create a content type
- Click Add another field
- Select Custom tab
- Choose Unique Link with QR Code
- Configure the field:
- Name: Give your field a name (e.g.,
uniqueLink) - Base URL: Set your desired base URL (e.g.,
https://yoursite.com) - Optionally add regex validation for the unique ID
- Name: Give your field a name (e.g.,
3. Use the Field
When creating or editing content:
- Enter a unique ID in the input field
- The plugin will automatically:
- Display the generated full URL below the input
- Show a "Copy" button to copy the URL to clipboard
- Generate and display a QR code that links to the URL
Example
If you set:
- Base URL:
https://mysite.com - Unique ID:
abc123
The plugin will generate:
- Full URL:
https://mysite.com/abc123 - A scannable QR code for this URL
Development
# Install dependencies
yarn install
# Build the plugin
yarn build
# Watch for changes
yarn watchRequirements
- Strapi v5.x
- Node.js >= 18.x
- TypeScript
License
MIT
