Create an API application to use with a Freebox.
Compatible Freeboxes:
- Freebox Mini 4K
- Freebox Revolution (untested)
Read the Freebox API documentation before using.
The script uses the following environment variables:
FREEBOX_URL
(required): URL where to reach your FreeboxAPP_ID
(required): Unique identifier for your appAPP_NAME
(required): Your app nameAPP_VERSION
(required): Your app's versionDEVICE_NAME
(optional): Where the app will run / be deployed
This repository comes bundled as a Docker image for convenience:
$ docker run \
-it \
--rm \
-e FREEBOX_URL="http://192.168.1.1" \
-e APP_ID="com.example.my-app" \
-e APP_NAME="My App" \
-e APP_VERSION="1.2.3" \
-e DEVICE_NAME="NAS" \
47ng/create-freebox-app
- Install dependencies
$ yarn install
or
$ npm install
- Setup your environment
Create a .env
file next to package.json
, with the contents (customize to your needs):
FREEBOX_URL="http://192.168.1.1"
APP_ID="com.example.my-app"
APP_NAME="My App"
APP_VERSION="1.2.3"
DEVICE_NAME="NAS"
- Run the script:
$ yarn start
or
$ npm run start
Don't forget to stay close to your Freebox to manually accept the app authorization request.
Use your app token to login to the Freebox API.
I'm planning on making an express middleware library to facilitate the exchange of session tokens with a Freebox, stay tuned.