{"id":13509596,"url":"https://github.com/edgurgel/pusher","last_synced_at":"2025-04-12T22:54:53.098Z","repository":{"id":46487819,"uuid":"11939071","full_name":"edgurgel/pusher","owner":"edgurgel","description":"Elixir library to access the Pusher REST API.","archived":false,"fork":false,"pushed_at":"2024-06-28T04:38:04.000Z","size":77,"stargazers_count":27,"open_issues_count":0,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T22:54:49.622Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/pusher","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/edgurgel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-07T01:57:40.000Z","updated_at":"2025-03-25T18:42:14.000Z","dependencies_parsed_at":"2025-01-06T12:29:48.011Z","dependency_job_id":"c5678935-4831-4378-91b5-5679205e7368","html_url":"https://github.com/edgurgel/pusher","commit_stats":{"total_commits":87,"total_committers":12,"mean_commits":7.25,"dds":0.4252873563218391,"last_synced_commit":"83d6c7a5cd01e455a15fc89408ca89b64eeb16ec"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgurgel%2Fpusher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgurgel%2Fpusher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgurgel%2Fpusher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgurgel%2Fpusher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edgurgel","download_url":"https://codeload.github.com/edgurgel/pusher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643048,"owners_count":21138353,"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:01:10.086Z","updated_at":"2025-04-12T22:54:53.075Z","avatar_url":"https://github.com/edgurgel.png","language":"Elixir","funding_links":[],"categories":["Third Party APIs"],"sub_categories":[],"readme":"# Pusher [![Build Status](https://travis-ci.org/edgurgel/pusher.png?branch=master)](https://travis-ci.org/edgurgel/pusher) [![Hex pm](http://img.shields.io/hexpm/v/pusher.svg?style=flat)](https://hex.pm/packages/pusher)\n## Description\n\nElixir library to access the Pusher REST API.\n\n## Usage\n\n### Rest client\n\nDefine your Pusher.Client\n\n```elixir\nciient = %Pusher.Client{app_id: \"app_id\", app_key: \"app_key\", secret: \"my_secret\"}\nciient = %Pusher.Client{endpoint: \"https://my_custom_pusher:8080\", app_id: \"app_id\", app_key: \"app_key\", secret: \"my_secret\"}\n```\n\n```elixir\nPusher.trigger(client, \"message\", %{ text: \"Hello!\" }, \"chat-channel\")\n```\n\nTo get occupied channels:\n\n```elixir\nPusher.channels(client)\n```\n\nTo get users connected to a presence channel\n\n```elixir\nPusher.users(client, \"presence-demo\")\n```\n\n### Websocket client\n\n## Usage\n\n```iex\niex\u003e {:ok, pid} = Pusher.WS.start_link(\"ws://localhost:8080\", \"app_key\", \"secret\", stream_to: self)\n{:ok, #PID\u003c0.134.0\u003e}\niex\u003e Pusher.WS.subscribe!(pid, \"channel\")\n:ok\niex\u003e Pusher.WS.subscribe!(pid, \"presence-channel\", %PusherClient.User{id: \"123\", info: %{a: \"b\"}})\n:ok\n```\n\n```iex\n# self will receive messages like this:\n%{channel: nil,\n  data: %{\"activity_timeout\" =\u003e 120,\n    \"socket_id\" =\u003e \"b388664a-3278-11e4-90df-7831c1bf9520\"},\n  event: \"pusher:connection_established\"}\n\n%{channel: \"channel\", data: %{}, event: \"pusher:subscription_succeeded\"}\n```\n\nThat's it!\n\nYou can disconnect too:\n\n```iex\niex\u003e Pusher.WS.disconnect!(pid)\n:stop\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgurgel%2Fpusher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgurgel%2Fpusher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgurgel%2Fpusher/lists"}