Skip to main content

reeln-cli plugin for Meta platform integration (Facebook Live, Instagram, Threads)

Project description

reeln-plugin-meta

A reeln-cli plugin for Meta platform integration (Facebook Live, Instagram, Threads).

Install

pip install reeln-plugin-meta

Or for development:

git clone https://github.com/StreamnDad/reeln-plugin-meta
cd reeln-plugin-meta
make dev-install

Features

  • Facebook Live Video — creates a live video on your Facebook Page during ON_GAME_INIT
  • Writes the livestream embed URL to context.shared["livestreams"]["meta"]
  • All features are opt-in via boolean feature flags (default false)

Facebook Developer Setup

1. Create a Facebook Developer Account

Go to developers.facebook.com and register as a developer.

2. Create an App

  1. Go to My AppsCreate App
  2. Select a use case (e.g. OtherBusiness)
  3. Choose Business app type
  4. Fill in app name, contact email, and select a Business portfolio
  5. Click Create App

3. Get a Page Access Token

  1. Go to the Graph API Explorer
  2. Select your app from the Meta App dropdown
  3. Click Generate Access Token
  4. Grant the following permissions:
    • pages_show_list
    • pages_manage_posts
    • pages_read_engagement
    • publish_video
  5. Select your Page from the User or Page dropdown
  6. Copy the Page Access Token

Note: The default token expires in ~1 hour. For a long-lived token (60 days), exchange it via the Access Token Debugger or the token exchange endpoint:

GET /oauth/access_token?grant_type=fb_exchange_token
  &client_id=APP_ID&client_secret=APP_SECRET
  &fb_exchange_token=SHORT_LIVED_TOKEN

4. Save the Token to a File

mkdir -p secrets
echo "YOUR_PAGE_ACCESS_TOKEN" > secrets/meta_page_token.txt

5. Get Your Page ID

Find your Page ID in Page Settings → About → Page ID, or query it via the API:

curl "https://graph.facebook.com/v24.0/me?access_token=YOUR_TOKEN"

6. Configure the Plugin

reeln config set meta.page_access_token_file ./secrets/meta_page_token.txt
reeln config set meta.page_id YOUR_PAGE_ID
reeln config set meta.create_livestream true

Or edit your reeln config JSON directly:

{
  "plugins": {
    "enabled": ["meta"],
    "settings": {
      "meta": {
        "page_access_token_file": "./secrets/meta_page_token.txt",
        "page_id": "123456789",
        "create_livestream": true
      }
    }
  }
}

7. App Review

The publish_video permission may require App Review for production use. During development, you can use the token with your own Pages without review.

Configuration

Feature Flags

Each capability is gated behind a boolean flag (default false):

Field Default Description
create_livestream false Enable Facebook Live Video creation on ON_GAME_INIT
dry_run false Log API calls without executing them

Required Settings

Field Type Description
page_access_token_file str Path to Facebook Page access token file
page_id str Facebook Page ID

Livestream Settings

Field Type Default Description
graph_api_version str v24.0 Graph API version
status str LIVE_NOW Broadcast status (LIVE_NOW or UNPUBLISHED)
privacy str EVERYONE Privacy setting (EVERYONE or SELF)
content_category str SPORTS Content category (SPORTS, VIDEO_GAMING, etc.)
game_id str "" Facebook game ID to tag the broadcast with
save_vod bool true Save a VOD recording after broadcast ends
published bool true Publish VOD to Page timeline after broadcast ends
stop_on_delete_stream bool false Auto-end broadcast when RTMP stream disconnects

All settings can be overridden per named profile. For example, a config.testing.json profile could set "privacy": "SELF" for test broadcasts while your default config stays "EVERYONE" for game day.

Development

make dev-install      # uv venv + editable install with dev deps
make reeln-install    # install into sibling reeln-cli venv
make test             # pytest with 100% coverage
make lint             # ruff check
make format           # ruff format
make check            # lint + mypy + test

License

AGPL-3.0-only

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reeln_plugin_meta-0.4.0.tar.gz (42.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reeln_plugin_meta-0.4.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file reeln_plugin_meta-0.4.0.tar.gz.

File metadata

  • Download URL: reeln_plugin_meta-0.4.0.tar.gz
  • Upload date:
  • Size: 42.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for reeln_plugin_meta-0.4.0.tar.gz
Algorithm Hash digest
SHA256 27b6832a183199aa2674fb946a1ff18260b4451f82225742b9be36810539dde7
MD5 434dae70b54b2e64f52250f30863c5dc
BLAKE2b-256 bf4be0a3d49fcd3b8db8aebdfc6c1cfa9181f7c248c418f463a605c869167b32

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_plugin_meta-0.4.0.tar.gz:

Publisher: release.yml on StreamnDad/reeln-plugin-meta

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reeln_plugin_meta-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for reeln_plugin_meta-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc7699933abcace0a68d4de382f40ead65e902dafdf6d739eb4d556f975fd3d8
MD5 a48d9cb323693b2bd9da472e8a32f54e
BLAKE2b-256 6533daddf4286826f85a60eafbc608a7f0e6fedc094a7fa3011bff441e5c5b46

See more details on using hashes here.

Provenance

The following attestation bundles were made for reeln_plugin_meta-0.4.0-py3-none-any.whl:

Publisher: release.yml on StreamnDad/reeln-plugin-meta

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page