finds.dev

trailheadapps/apex-recipes

A library of concise, meaningful examples of Apex code for common use cases following best practices.

View on GitHubHomepage ↗

★ 1,081ApexCC0-1.0updated Jun 2026

// the take

An official Salesforce-maintained collection of Apex code examples covering async patterns, SOQL/SOSL, triggers, platform events, callouts, encryption, and more. Each recipe is a self-contained class with a corresponding test — this is the reference implementation Salesforce themselves point developers to when they ask 'how do I do X in Apex?'. Squarely aimed at Salesforce developers from junior to mid-level.

The metadata-driven trigger framework (MetadataTriggerHandler + Custom Metadata) is the standout — it's a legitimate pattern for managing trigger dispatch without code deployments, and seeing it implemented correctly is rare. Test coverage is real: 95%+ codecov badge and the tests actually assert behavior rather than just bumping coverage numbers. The DataWeave-in-Apex section covers a feature most Apex devs ignore entirely, with working CSV↔JSON transform examples. CI pipeline is solid — scratch org creation, push, permset assignment, and data import all automated, so the examples are verified to actually deploy.

The recipes are self-contained by design, which means they don't show how these patterns compose in a real application — you get the puzzle pieces but not the assembled picture, which is where real Salesforce projects fall apart. The LDV (Large Data Volumes) section is thin: one class covering batch basics, nothing on chunking strategies, skinny tables, or the async SOQL patterns that actually matter when you have 10M+ records. No examples of named credential external credential types (the new post-Winter '23 model) — the callout recipes still use legacy named creds. The app UI (LWC components) is purely a recipe browser shell; it doesn't demonstrate LWC best practices like wire adapters with error handling or component communication patterns.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,081
Forks
552
Language
Apex
License
CC0-1.0
Last commit
2 Jun 2026

// nearby

If apex-recipes isn't quite it.

All repos →