Skip to content
Lucent
SEARCH LUCENT

Search guides, APIs, and examples.

GitHub

Very early and experimental. The language, the generated native code and every package API change without notice. Do not use Lucent in production.

Use a Lucent library

Install it with npm: lucent build compiles its modules with the app's, with their pods, dependencies and permissions.

terminal
npm i lucent-haptics
App.tsx
import { ImpactFeedbackStyle, impactAsync } from "lucent-haptics";
await impactAsync(ImpactFeedbackStyle.Heavy);

lucent build finds every Lucent package the app depends on, directly or not, and compiles its modules with the app's. Rebuild the app afterwards, after pod install on iOS.

  • The package's pods, Gradle dependencies and permissions come with it.
  • Info.plist entries it needs are added by the Expo config plugin. In a bare app, lucent build names each missing key: trip-tracker needs NSLocationWhenInUseUsageDescription in ios/App/Info.plist.
  • A package that doesn't support your Lucent version fails the build, and lucent doctor says which.
  • Lucent code can import a package's module too: import { impactAsync } from "lucent-haptics/src/haptics.lucent".