# trailheadapps/apex-recipes

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

Repository: https://github.com/trailheadapps/apex-recipes
Canonical: https://ross.abutalabs.com/products/apex-recipes
Homepage: https://developer.salesforce.com
Language: Apex
License: CC0-1.0
License Family: permissive
Topics: salesforce, apex, trigger, async, invocable, cache, integration
Last push: 2026-09-03T00:05:48+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 100, release rhythm 35, longevity 100
- inputs: {"age_days": 2150, "days_push": 0, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1092, forks 558 (observed 2026-09-03T02:15:19.939589+00:00)

## What it is
A Salesforce sample app providing a library of concise, best-practice Apex code examples for common use cases like triggers, async processing, invocable methods, caching, and integration. It is maintained by Trailhead Apps and deployable via Salesforce CLI, scratch orgs, or unlocked packages.

## Use cases
- learn apex best practices with example code
- find salesforce apex code samples for triggers
- examples of async apex and batch jobs
- apex invocable method examples
- how to do callouts and integration in apex
- sample apex code for platform cache
- study material for salesforce developer certification

## When to choose
- you are a Salesforce developer looking for clear, enterprise-pattern Apex examples
- you want reference code following best practices to copy into your org
- you are learning Apex or preparing for Trailhead badges

## When to avoid
- you need a production-ready library to drop into your app rather than illustrative samples
- you work outside the Salesforce/Apex ecosystem
- you need Lightning Web Components examples rather than backend Apex code

## Facets
- artifact type: learning-resource
- maturity: active
- function: developer-tools, documentation, caching, testing
- domain: developer-tools, tutorials, apis
- platform: cloud, cli
- tags: salesforce, apex, sample-code, best-practices, triggers, async-apex, invocable-methods, integration

## Member repositories
- trailheadapps/apex-recipes (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-09-03T02:15:19.939589+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:48:59.037487+00:00, confidence not recorded.
  - readme: https://github.com/trailheadapps/apex-recipes (fetched 2026-09-03T02:15:19.939589+00:00, sha 1643f0c96984)
- Data as of 2026-08-30T08:39:29.467469+00:00.
