r/flipperzero • u/VVr3nch Community Manager • Dec 03 '24
Flipper Feed Introducing the JavaScript SDK for Flipper Zero
The JavaScript engine in Flipper Zero firmware provides a quick and simple way to develop applications. We're still extending its capabilities and adding new JS modules (most recent updates include GPIO and GUI modules). To further simplify the development process, we offer a JS SDK for Flipper Zero. It's distributed as an NPM package, so you can easily download it using a package manager: npm, pnpm, or yarn.
Main features of Flipper Zero JS SDK:
- Code completion
- Loading and running on Flipper with a single command
- Support for advanced syntax, such as arrow functions and import declarations
- JS Minifier (disabled by default; you can enable it in fz-sdk.config.json5)
🐬 Check out the post images to see the JS SDK in action.
How to use the JS SDK with your Flipper Zero:
- Install Node.js: nodejs.org/en/download/package-manager
- Use the npx @flipperdevices/create-fz-app@latest command to create a JS app template. The app code is in the index.ts file.
- Run the npm start command from your app directory to run the app on Flipper Zero connected via USB.
Learn more about Flipper Zero JavaScript SDK: npmjs.com/package/@flipperdevices/fz-sdk
Let us know in the comments if you'd like to see more posts about using JavaScript on Flipper Zero.



37
u/[deleted] Dec 03 '24
Awesome! I love to see more Flipper development.
14
u/Vivid-Benefit-9833 Dec 03 '24
Yea these types of posts are awesome and I think more of them are needed... this is some of the more difficult stuff to do on F0 and some of the coolest stuff and potentially most useful too... but know how to use it and what it's potential uses might be for people who aren't familiar w JavaS isn't necessarily the easiest thing to work out...
So yea, I at least would very much appreciate any and all post explaining uses and ideas in how to use JavaS on F0....
And thanks Wrench for all your work and time into the community 👍 for sure one of the MVPs of the F0 community.
8
u/FormulaSun12 Dec 03 '24
Can you code in Python too?
6
u/Gacut Dec 03 '24
Python when?
4
u/lerobinbot Dec 03 '24
nice
4
u/davidgrayPhotography Dec 03 '24
I've been following this for a while now because I'm keen on writing some more advanced BadUSB stuff, but I'd love, LOVE to see some Date stuff in there.
For example, I've got about 100 laptops. A bunch of them have flat CMOS batteries and occasionally need the date and time reset. I'd love to write a BadUSB Javascript app that would get the time and date from the Flipper and convert it to a series of keypresses so when I run the app, the date and time will be set correctly. In this specific case, I'd be looking to get the day, month, year, hour, minute and second as integers so I could send "press down '2024 % 100' times to select 2024"
I know it's a limitation of mJS, but I'm wondering if it's possible to do something with an addon module?
3
u/moonflower_C16H17N3O Dec 03 '24
This is really interesting. Thank you.
3
u/Disturbed2k14 Jan 20 '25 edited Jan 20 '25
I'm stuck, been trying to get this working for a bit now and am just going in circles at this point, everything seemed to be going well until I ran "npm start" which gives me the following:
'tsc' is not recognized as an internal or external command, operable program or batch file.I've done some googling and only seem to be breaking it further
EDIT: fixed it, needed to edit line 5 in package,json to add npx before tsc:
"build": "npx tsc && node node_modules/@flipperdevices/fz-sdk/sdk.js build"1
u/furculture Dec 03 '24
I don't have a use for this, but I'm glad that this will get used by people who anticipated it.
1
u/gastro_psychic Dec 04 '24
This is great!
1
u/kemacal Dec 04 '24
Very slick! Well done 👏
1
u/MerpoB Dec 04 '24
Cool. I’ll have to look into this.
1
u/narcabusesurvivor18 Dec 04 '24
This is flippin awesome!