Sets up AshOpenFeed in a Phoenix + Ash application.
What it generates
MyApp.OpenFeed— an Ash domain for the OpenFeed resources.MyApp.OpenFeed.Grant— the grant resource, with the extension applied.MyApp.OpenFeed.Key— the signing key resource, so keys are shared across nodes rather than generated per node.MyAppWeb.OpenFeedController— the consent flow. Generated, not library-owned, because what happens after a successful grant — which user to attach it to, where to redirect, what to flash — is inherently application-specific. Edit it freely.- Routes for
/openfeed/connectand/openfeed/callback. config :my_app, :openfeed, ...inruntime.exs.
Usage
mix igniter.install ash_openfeedOptions
--repo— the Ecto repo for the generated resources. Inferred if there is only one.--domain— the Ash domain module to generate. Defaults toMyApp.OpenFeed.--user-resource— add abelongs_toto this resource on the grant, and wire the controller to attach grants toconn.assigns.current_user.--no-controller— skip the controller and routes.
After running
Generate migrations:
mix ash.codegen install_ash_openfeedRun them:
mix ash.migrateGenerate a signing key and register it with OpenFeed:
mix openfeed.gen.key --print # insert into MyApp.OpenFeed.Key, then: mix openfeed.jwks --path ...Set
OPENFEED_CLIENT_IDand register the redirect URI at https://app.openfeed.au/registered-apps.