{"id":13657864,"url":"https://github.com/hedwig-im/hedwig_xmpp","last_synced_at":"2026-03-14T16:39:58.454Z","repository":{"id":57504734,"uuid":"46999998","full_name":"hedwig-im/hedwig_xmpp","owner":"hedwig-im","description":"XMPP Adapter for Hedwig","archived":false,"fork":false,"pushed_at":"2019-07-09T14:07:25.000Z","size":23,"stargazers_count":12,"open_issues_count":4,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T09:05:03.453Z","etag":null,"topics":["elixir","hedwig","xmpp"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hedwig-im.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-27T21:29:35.000Z","updated_at":"2023-09-01T10:47:24.000Z","dependencies_parsed_at":"2022-08-30T07:11:34.676Z","dependency_job_id":null,"html_url":"https://github.com/hedwig-im/hedwig_xmpp","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedwig-im%2Fhedwig_xmpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedwig-im%2Fhedwig_xmpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedwig-im%2Fhedwig_xmpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hedwig-im%2Fhedwig_xmpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hedwig-im","download_url":"https://codeload.github.com/hedwig-im/hedwig_xmpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252847489,"owners_count":21813453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","hedwig","xmpp"],"created_at":"2024-08-02T05:00:52.195Z","updated_at":"2026-03-14T16:39:58.350Z","avatar_url":"https://github.com/hedwig-im.png","language":"Elixir","funding_links":[],"categories":["Adapters"],"sub_categories":[],"readme":"# Hedwig XMPP Adapter\n\n\u003e An XMPP Adapter for [Hedwig](https://github.com/hedwig-im/hedwig)\n\n## Getting started\n\nLet's generate a new Elixir application with a supervision tree:\n\n```\nλ mix new alfred --sup\n* creating README.md\n* creating .gitignore\n* creating mix.exs\n* creating config\n* creating config/config.exs\n* creating lib\n* creating lib/alfred.ex\n* creating test\n* creating test/test_helper.exs\n* creating test/alfred_test.exs\n\nYour Mix project was created successfully.\nYou can use \"mix\" to compile it, test it, and more:\n\n    cd alfred\n    mix test\n\nRun \"mix help\" for more commands.\n```\n\nChange into our new application directory:\n\n```\nλ cd alfred\n```\n\nAdd `hedwig_xmpp` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n   [{:hedwig_xmpp, \"~\u003e 1.0\"}]\nend\n```\n\nEnsure `hedwig_xmpp` is started before your application:\n\n```elixir\ndef application do\n  [applications: [:hedwig_xmpp]]\nend\n```\n\n### Generate our robot\n\n```\nλ mix hedwig.gen.robot\n\nWelcome to the Hedwig Robot Generator!\n\nLet's get started.\n\nWhat would you like to name your bot?: alfred\n\nAvailable adapters\n\n1. Hedwig.Adapters.XMPP\n2. Hedwig.Adapters.Console\n3. Hedwig.Adapters.Test\n\nPlease select an adapter: 1\n\n* creating lib/alfred\n* creating lib/alfred/robot.ex\n* updating config/config.exs\n\nDon't forget to add your new robot to your supervision tree\n(typically in lib/alfred.ex):\n\n    worker(Alfred.Robot, [])\n```\n\n### Supervise our robot\n\nWe'll want Alfred to be supervised and started when we start our application.\nLet's add it to our supervision tree. Open up `lib/alfred.ex` and add the\nfollowing to the `children` list:\n\n```elixir\nworker(Alfred.Robot, [])\n```\n\n### Configuration\n\nThe next thing we need to do is configure our bot for our XMPP server. Open up\n`config/config.exs` and let's take a look at what was generated for us:\n\n```elixir\nuse Mix.Config\n\nconfig :alfred, Alfred.Robot,\n  adapter: Hedwig.Adapters.XMPP,\n  name: \"alfred\",\n  aka: \"/\",\n  responders: [\n    {Hedwig.Responders.Help, []},\n    {Hedwig.Responders.Ping, []}\n  ]\n```\n\nSo we have the `adapter`, `name`, `aka`, and `responders` set. The `adapter` is\nthe module responsible for handling all of the XMPP details like connecting and\nsending and receiving messages over the network. The `name` is the name that our\nbot will respond to. The `aka` (also known as) field is optional, but it allows\nus to address our bot with an alias. By default, this alias is set to `/`.\n\nFinally we have `responders`. Responders are modules that provide functions that\nmatch on the messages that get sent to our bot. We'll discuss this further in\na bit.\n\nWe'll need to provide a few more things in order for us to connect to our XMPP\nserver. We'll need to provide our bot's `jid` and `password` as well as a list\nof rooms we want our bot to join once connected. Let's see what that looks like:\n\n```elixir\nuse Mix.Config\n\nconfig :alfred, Alfred.Robot,\n  adapter: Hedwig.Adapters.XMPP,\n  name: \"alfred\",\n  aka: \"/\",\n  # fill in the appropriate jid for your bot\n  jid: \"alfred@localhost\",\n  # fill in the appropriate password for your bot\n  password: \"password\",\n  rooms: [\n    # fill in the appropriate rooms for your XMPP server\n    {\"lobby@conference.localhost\", []}\n  ],\n  responders: [\n    {Hedwig.Responders.Help, []},\n    {Hedwig.Responders.Ping, []}\n  ]\n```\n\nGreat! We're ready to start our bot. From the root of our application, let's run\nthe following:\n\n```\nλ mix run --no-halt\n```\n\nThis will start our application along with our bot. Our bot should connect to\nthe server and join the configured room(s). From there, we can connect with our\nfavourite XMPP client and begin sending messages to our bot.\n\nSince we have the `Help` responder installed, we can say `alfred help` and we\nshould see a list of usage for all of the installed responders.\n\n## What's next?\n\nWell, that's it for now. Make sure to read the [Hedwig Documentation](http://hexdocs.pm/hedwig) for more\ndetails on writing responders and other exciting things!\n\n## LICENSE\n\nCopyright (c) 2015, Sonny Scroggin.\n\nHedwig XMPP source code is licensed under the [MIT License](https://github.com/hedwig-im/hedwig_xmpp/blob/master/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedwig-im%2Fhedwig_xmpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhedwig-im%2Fhedwig_xmpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedwig-im%2Fhedwig_xmpp/lists"}