@flare-engine/engine
Convenience integration layer — createGame(config) is a pure factory that constructs World + Camera2D + Renderer + SpriteBatch + InputManager + AudioManager + AssetManager + SceneManager + GameLoop and returns them with start() / stop(). Does not own the render loop or Skia canvas lifecycle — those belong to @flare-engine/react.
The package ships two entry points:
.(default) — full curated barrel: the 14 headless packages +@flare-engine/dynamics+@flare-engine/postfx+ curated@flare-engine/reactexports. Pulls in React Native at module scope.CompiledShaderandSkImageLikefrom postfx are aliased asPostFxCompiledShaderandPostFxSkImageLiketo avoid clashing with the render/assets versions. Dynamics'WorldandBodyare aliased asDynamicsWorldandDynamicsBodyso the ECSWorldkeeps the name. React'sGameConfigis re-exported asGameViewConfigto avoid clashing withcreateGame's ownGameConfig../headless— RN-free subset: the 14 headless packages (math, events, core, ecs, render, input, physics, audio, assets, scene, animation, particles, tilemap, debug) pluscreateGameand tier2-wiring. No@flare-engine/react, no@flare-engine/postfx, no@flare-engine/dynamics. Safe for web-only and Node consumers.
createTier2Wiring glues optional AchievementsProvider / LeaderboardsProvider / AnalyticsProvider instances to a Tier-2 event source via declarative rules.
Install
bun add @flare-engine/engine
Usage — full stack (React Native + Web)
import { createGame } from '@flare-engine/engine';
const game = createGame({ fixedDt: 1 / 60 });
game.start();
Usage — headless (web-only / Node / tests)
import { createGame, World, GameLoop } from '@flare-engine/engine/headless';
const game = createGame({ fixedDt: 1 / 60 });
game.start();
See API spec.
React Native New Architecture
Flare's headless packages are architecture-agnostic pure TypeScript. @flare-engine/react requires the New Architecture. It peers react-native-reanimated >= 4.0.0 and react-native-worklets >= 0.7.0, and Reanimated 4 is New-Architecture-only — so an app using <GameView> must run with newArchEnabled=true.
In practice this costs nothing: the New Architecture has been RN's default since 0.76, and every @flare-engine/create template pins an Expo SDK whose React Native forces it on.
Old-architecture support was dropped deliberately, in ADR-0002. The earlier
>= 3.19.1floor was chosen to keep Reanimated 3 — and therefore old-architecture apps — viable, but the claim was never verifiable: no scaffolder template can produce such an app, becauseexpo prebuildoverrides anapp.jsonopt-out. Rather than keep shipping a promise we could not test, the engine now depends onreact-native-workletsdirectly, which also removes a per-frame allocation on the native render path.
License
Apache-2.0