{"id":13508153,"url":"https://github.com/cobenian/raygun","last_synced_at":"2025-10-21T16:36:02.269Z","repository":{"id":36440356,"uuid":"40745386","full_name":"Cobenian/raygun","owner":"Cobenian","description":"A raygun client for Elixir","archived":false,"fork":false,"pushed_at":"2020-06-04T18:27:43.000Z","size":476,"stargazers_count":19,"open_issues_count":7,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T22:01:54.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cobenian.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-15T03:36:00.000Z","updated_at":"2023-09-01T10:59:13.000Z","dependencies_parsed_at":"2022-08-18T18:21:59.377Z","dependency_job_id":null,"html_url":"https://github.com/Cobenian/raygun","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobenian%2Fraygun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobenian%2Fraygun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobenian%2Fraygun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobenian%2Fraygun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cobenian","download_url":"https://codeload.github.com/Cobenian/raygun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301963,"owners_count":20755512,"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":[],"created_at":"2024-08-01T02:00:48.970Z","updated_at":"2025-10-21T16:36:02.152Z","avatar_url":"https://github.com/Cobenian.png","language":"Elixir","funding_links":[],"categories":["Framework Components"],"sub_categories":[],"readme":"# Raygun [![Build Status](https://travis-ci.org/Cobenian/raygun.svg?branch=master)](https://travis-ci.org/Cobenian/raygun) [![Hex.pm](https://img.shields.io/hexpm/v/raygun.svg?maxAge=2592000)](https://hex.pm/packages/raygun) [![Hex.pm](https://img.shields.io/hexpm/dt/raygun.svg?maxAge=2592000)](https://hex.pm/packages/raygun) [![Coverage Status](https://coveralls.io/repos/github/Cobenian/raygun/badge.svg?branch=master)](https://coveralls.io/github/Cobenian/raygun?branch=master)\n\n\nCapture and send errors in your Elixir applications to Raygun for centralized\nbug reporting.\n\n## Install\n\nAdd the dependency to your mix.exs file.\n\n```elixir\ndef deps do  \n  [{:raygun, \"~\u003e 0.3.1\"}]\nend\n```\n\nAdd Raygun, httpoison and tzdata to the list of applications.\n\n```elixir\ndef application do\n  [applications: [:logger, :raygun, :httpoison, :tzdata]\nend\n```\n\n## Configuration\n\nAdd the following entry to your config/config.exs file.\n\n```elixir\nconfig :raygun,\n    api_key: \"\u003cINSERT YOUR API KEY HERE\u003e\"\n```\n\nYou can *OPTIONALLY* add other configuration options as well. They will be sent\nwith every error.\n* tags: list of metadata strings\n* url: a reference URL\n* client_name: the name of the application as you want it to appear in Raygun\n* client_version: the version of the application as you want it to appear in Raygun\n\n```elixir\nconfig :raygun,\n    api_key: \"\u003cINSERT YOUR API KEY HERE\u003e\",\n    tags: [\"tag1\", \"tag2\"],\n    url: \"http://docs.myapp.example.com\",\n    client_name: \"MyApp\",\n    client_version: \"2.3.4\"\n```\n\nIf you use a Plug, the version (client_version above) should be auto detected for you.\n\n## Usage\n\nThere are three different ways you can use Raygun. All three ways may be combined,\nbut you _might_ send the same message multiple times if you do that.\n\n### Via Plug in Phoenix\n\nAdd the plug to your router:\n\n```elixir\ndefmodule YourApp.Router do\n  use Phoenix.Router\n  use Raygun.Plug\n\n  # ...\nend\n```\n\nYou can also provide a function that takes a Plug.Conn and returns a map with\ninformation about the logged in user.\n\n```elixir\ndefmodule YourApp.Router do\n  use Phoenix.Router\n  use Raygun.Plug, user: fn(conn) -\u003e\n    %{\n      identifier: \"\u003cuser id\u003e\",\n      isAnonymous: false, # false if logged in, true if not logged in\n      email: \"email@example.com\",\n      fullName: \"John Doe\",\n      firstName: \"John\",\n      uuid: \"\u003cuuid\u003e\"\n    }\n  end\n\n  # ...\nend\n```\n\n### Via the Logger\n\nAny error logged with automatically be sent to Raygun.\n\nConfigure the Logger to use the Raygun backend. You can do this programmatically\n\n  ```elixir\n  Logger.add_backend(Raygun.Logger)\n  ```\n\nor via configuration by adding Raygun as a backend in config/config.exs:\n\n  ```elixir\n  config :logger,\n    backends: [:console, Raygun.Logger]\n  ```\n\nAny messages logged at :error level will be automatically sent to Raygun.\n\nIf you would like messages to be associated with a system user then add the\nfollowing configuration to config/config.exs:\n\n  ```elixir\n  config :raygun,\n      system_user: %{\n        \t\t\tidentifier: \"myuserid\",\n        \t\t\tisAnonymous: true,\n        \t\t\temail: \"myuserid@example.com\",\n        \t\t\tfullName: \"Jane Doe\",\n        \t\t\tfirstName: \"Jane\",\n        \t\t\tuuid: \"b07eb66c-9055-4847-a173-881b77cdc83e\"\n      \t\t  }\n  ```\n\n### Any Elixir code\n\nStart our Raygun application (if you did not configure it as an application\nin mix.exs)\n\n```elixir\nRaygun.start\n```\n\nSend a string message to Raygun:\n\n```elixir\nRaygun.report_message \"Oh noes.\"\n```\n\nReport an exception programmatically. Be sure that System.stacktrace will be\nthe correct stack trace!\n\n```elixir\ntry do\n  :foo = :bar\nrescue\n  exception -\u003e Raygun.report_exception(exception)\nend\n```\n\nOr capture the stacktrace explicitly yourself and pass it to Raygun.\n\n```elixir\ntry do\n  :foo = :bar\nrescue\n  exception -\u003e\n    stacktrace = System.stacktrace\n    Raygun.report_stacktrace(stacktrace, exception)\nend\n```  \n\nBoth forms allow some custom context to be passed as an optional final\nparameters as a Map. This will appear as 'userCustomData' under the custom\ntab in Raygun's web interface.\n\n```elixir\ntry do\n  :foo = :bar\nrescue\n  exception -\u003e\n    Raygun.report_stacktrace(System.stacktrace, exception, %{env: Mix.env})\nend\n```\n\n## License\n\n[LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobenian%2Fraygun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobenian%2Fraygun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobenian%2Fraygun/lists"}