What a trigger is
A trigger is a rule authored inside an effect package. It connects a supported user action or tracked state to a visual response, such as revealing an object, changing a material, or starting an animation.
For example, an effect can react when a face appears, the user turns their head, or a supported eye gesture occurs. The exact behaviour belongs to that package. Your app applies the package in the normal way and does not need to implement its gesture detection.
Trigger behaviour
Triggers generally produce one of two kinds of response:
| Behaviour | What it does | Example |
|---|---|---|
| Continuous | Changes a visual value as the tracked action changes | Move or blend an authored element as the user turns |
| Event | Starts, stops, toggles, or replays an authored action | Reveal a prop or play an animation after a gesture |
An effect author can define thresholds, timing, and reset behaviour inside the package. These settings are not global app settings and can differ between two effects that react to the same action.
What the app controls
The host app controls when the package is applied or removed. The package controls its own supported trigger reactions while active.
Apps should not assume that every effect contains a trigger. If the product UI needs instructions such as “turn your head” or “blink,” store that instruction with the catalog item or other product metadata supplied for that effect.
If an authored package also exposes public runtime parameters, the app can change those parameters independently. Do not guess trigger names or attempt to replace the package's authored behaviour with undocumented tracking data.
Availability and fallback
Trigger support depends on both the platform and the exact effect package. Packages should remain visually safe when no supported face is present or when tracking is temporarily unavailable. A trigger may pause, reset, or hide its dependent content according to its authored behaviour.
The Web SDK is a developer preview, so test each triggered effect separately before treating it as equivalent to a native release. See the current platform support matrix for status.
Testing triggered effects
Test on supported physical devices with the same packages that will ship. At a minimum, verify:
- the initial state before a face or supported action is detected
- the expected action and visual response
- temporary face loss and re-entry
- front-camera mirroring and device rotation
- low light, partial occlusion, glasses, and fast movement
- removal or replacement while an animation is running
- acceptable frame rate and temperature during a longer session
Trigger behaviour is part of the authored effect experience. A package that is valid but reacts poorly should be corrected or replaced before release.
Next steps
- Add an AR face mask
- Understand filters and effects
- Control runtime parameters
- Review limits and performance