Rocket is an Elixir client for Firebase Cloud Messaging HTTP v1.
The current maintenance focus is test coverage, correctness, and modernization. New features are intentionally deferred until the cleanup baseline is stable.
- Elixir 1.18.x
- Erlang/OTP 26.2.x
The local toolchain is documented in .tool-versions.
Add Rocket to your dependencies:
def deps do
[
{:rocket, "~> 0.1"}
]
endRocket expects Google service-account credentials as JSON. The default configuration reads credentials from the GCP_CREDENTIALS environment variable:
export GCP_CREDENTIALS='{"project_id":"my-project", "...":"..."}'The default response handler logs request outcomes:
config :rocket,
response_handler: Rocket.Response.DefaultHandler,
workers: 2Custom response handlers implement Rocket.Response.ResponseHandler.
Rocket.push/1 performs a synchronous FCM request and returns a structured result:
payload = %{
"message" => %{
"token" => "device-token",
"notification" => %{
"title" => "Hello",
"body" => "World"
}
}
}
Rocket.push(payload)Successful responses return {:ok, decoded_body}. Request, configuration, encoding, HTTP, and FCM errors return {:error, reason}.
The GenStage producer/consumer modules are used for queued internal processing. They are not the public boundary for new features unless that API is deliberately designed and documented.
Fetch dependencies:
mix deps.getRun the verification suite:
mix format --check-formatted
mix compile --warnings-as-errors
mix deps.audit
mix credo --strict
mix test --cover
mix dialyzer --format shortRocket defaults to Finch for HTTP requests and starts a supervised pool named Rocket.Finch when the default client is used. Finch is an optional dependency; applications that provide their own :http_client do not need to include it.
The coverage threshold is enforced by mix test --cover and is currently set to 90%.
See CHANGELOG.md.