Generate beautiful, memorable, and poetic API keys and unique identifiers for your applications.
Keyfleur creates human-readable, aesthetically pleasing API keys and unique identifiers inspired by natural language patterns and poetry. Unlike traditional random strings, Keyfleur keys are designed to be both functional and beautiful.
Gleam-LucidFire-Radiant
SyrelRa-ArLeriS
Nova-437-Eclipse
Pulse88.88esluP
- 🌈 Multiple generation modes (haiku, lace, sonnet, etc.)
- 🎨 Thematic word collections (celestial, oceanic, forest, etc.)
- 🔒 Unique and memorable keys suitable for API tokens, user IDs, and more
- 💻 Fully typed TypeScript implementation
- 📦 Zero dependencies
# NPM
npm install keyfleur
# Yarn
yarn add keyfleur
# PNPM
pnpm add keyfleur
import { poeticKey } from 'keyfleur';
// Generate a key with default settings (haiku mode, haiku theme)
const key = poeticKey();
console.log(key); // e.g., "LyrAeli-NuviaSirune-OriaEvara"
// Specify a mode and theme
const celestialKey = poeticKey('sigil', 'celestial');
console.log(celestialKey); // e.g., "Nebula-342-Comet"
haiku
- Creates a three-part key based on syllable counts (5-7-5)lace
- Generates a palindrome-like patternmirrora
- Creates a mirrored syllable patternrune
- Combines a haiku with a time-based runesonnet
- Creates a two-part key with syllable embellishmentssigil
- Generates a word-number-word patternseed
- Creates a word prefix with hexadecimal suffixmantra
- Repeats a word with a final different wordquartz
- Creates a complex pattern with reversed text and numbers
haiku
- Abstract poetic termsnocturnal
- Night and darkness-related wordssunny
- Light and brightness-related wordsfloreal
- Flower and plant-related wordsoceanic
- Ocean and sea-related wordscrystalline
- Crystal and gem-related wordsmythic
- Mythology and legend-related wordsforest
- Forest and woodland-related wordsdesert
- Desert and arid-related wordscelestial
- Astronomy and space-related wordslibrary
- Books and writing-related wordsdecay
- Entropy and decay-related wordssteampunk
- Steampunk and mechanical-related words
import { poeticKey, THEMES, MODES, ThemeKey, ModeKey } from 'keyfleur';
// Generate multiple keys
const generateKeys = (count: number, mode: ModeKey, theme: ThemeKey) => {
return Array.from({ length: count }, () => poeticKey(mode, theme));
};
// Get 5 crystalline-themed quartz keys
const crystalKeys = generateKeys(5, 'quartz', 'crystalline');
console.log(crystalKeys);
// Custom function to verify a key is in expected format
const isValidSigilKey = (key: string): boolean => {
const parts = key.split('-');
return parts.length === 3 &&
/^[A-Z][a-z]+$/.test(parts[0]) &&
/^\d{3}$/.test(parts[1]) &&
/^[A-Z][a-z]+$/.test(parts[2]);
};
const key = poeticKey('sigil', 'mythic');
console.log(`Key ${key} is ${isValidSigilKey(key) ? 'valid' : 'invalid'}`);
When installed globally, Keyfleur can be used from the command line:
# Install globally
npm install -g keyfleur
# Generate a key with default settings
keyfleur
# Generate keys with specific mode and theme
keyfleur --mode=sigil --theme=celestial
# Generate multiple keys
keyfleur --count=5 --mode=seed --theme=steampunk
- API Keys and tokens that are easy to read and share
- Session identifiers with aesthetic appeal
- Temporary access codes and passphrases
- Creative project names and codenames
- Game save IDs or world seeds
- Document and content identifiers
- Memorable reference codes
You can extend Keyfleur with your own themes and modes:
import { THEMES, MODES, ThemeKey, ModeKey } from 'keyfleur';
// Add a custom theme
const customThemes = {
...THEMES,
'cyberpunk': [
'neon', 'grid', 'hack', 'node', 'cyber', 'jack', 'bit', 'flux',
'pulse', 'wire', 'data', 'net', 'code', 'pixel', 'virt', 'synth'
]
};
// Add a custom mode function
const customModes = {
...MODES,
'trinity': (theme: ThemeKey) => {
const words = customThemes[theme] || customThemes['haiku'];
const randomWords = Array.from(
{ length: 3 },
() => words[Math.floor(Math.random() * words.length)]
).map(w => w.charAt(0).toUpperCase() + w.slice(1));
return randomWords.join('~');
}
};
// Use your custom mode and theme
function customPoeticKey(
mode: ModeKey | 'trinity' = 'haiku',
theme: ThemeKey | 'cyberpunk' = 'haiku'
): string {
const themeWords = customThemes[theme as ThemeKey] ? theme : 'haiku';
const modeFunc = customModes[mode as ModeKey] || customModes['haiku'];
return modeFunc(themeWords as ThemeKey);
}
console.log(customPoeticKey('trinity', 'cyberpunk')); // e.g., "Neon~Synth~Code"
Keyfleur uses various linguistic patterns and algorithms to generate keys:
- Syllable estimation - Analyzes word structure to approximate syllable counts
- Word selection - Chooses thematically appropriate words from curated collections
- Pattern generation - Applies various patterns and transformations to create diverse key styles
All keys are designed to be URL-safe, human-readable, and aesthetically pleasing.
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request