{"id":19849663,"url":"https://github.com/geeks-solutions/beeleex","last_synced_at":"2026-06-12T15:31:26.537Z","repository":{"id":105004022,"uuid":"547764645","full_name":"Geeks-Solutions/beeleex","owner":"Geeks-Solutions","description":"An Elixir dependency to integrate to the Bee Lee service","archived":false,"fork":false,"pushed_at":"2025-10-18T18:48:20.000Z","size":82,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-24T01:06:40.733Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Geeks-Solutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-10-08T08:44:19.000Z","updated_at":"2025-10-18T18:48:24.000Z","dependencies_parsed_at":"2025-11-24T01:02:11.447Z","dependency_job_id":null,"html_url":"https://github.com/Geeks-Solutions/beeleex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Geeks-Solutions/beeleex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geeks-Solutions%2Fbeeleex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geeks-Solutions%2Fbeeleex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geeks-Solutions%2Fbeeleex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geeks-Solutions%2Fbeeleex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Geeks-Solutions","download_url":"https://codeload.github.com/Geeks-Solutions/beeleex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Geeks-Solutions%2Fbeeleex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34251774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-12T13:22:32.770Z","updated_at":"2026-06-12T15:31:26.532Z","avatar_url":"https://github.com/Geeks-Solutions.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Beeleex\n\nBeeleex is a helper library that allows you to quickly setup the connections between your business unit and BeeLee.\n## Installation\n\n  In your mix.exs add this to your list of dependencies:\n\n  ```elixir\n  {:beeleex, \"~\u003e 0.1.0\"}\n  ```\n## Configuration\n### Common Configuration\nTo setup Beeleex in a phoenix application, all you need to do is the following (feel free to contribute for other frameworks):\n\n  - In your `router.ex`, add this line:\n  ```elixir\n  use Beeleex.Routes, scope: \"/beeleex\"\n  ```\n  You can customize the scope and provide the options of your choice to adjust this to your application need.\n\nThis provides a standard route to let Beelee verify tokens provided by your application when you are allowing your users to manage their companies, payment methods and browse their invoices.\n\nThen in your `endpoint.ex` add a plug to properly handle webhooks:\n```elixir\nplug Beeleex.WebhookPlug,\n    at: \"/api/webhook/beeleex\", # adjust to your choice\n    secret: {Application, :get_env, [:beeleex, :business_unit_secure_key]},\n    handler: MyApp.BeeleeHandler\n```\n\nThe `BeeleeHandler` module needs to implement the `handle_event/1` callback. For more details refer to the `Beeleex.WebhookPlug` module documentation.\n\n  - In your `config.ex`, add the following: \n  ```elixir\n  config :beeleex,\n  verify_token_action: %{module: YourModule, function: :function_name}\n  business_unit_secure_key: \"your bu secure key\",\n  business_unit_id: \"your bu_id\"\n  ```\n\nYou could also set the `debug_on` to true in your config if you would like to introspect all events sent to your Business Unit.\n\n## Usage\n### Token Verification\nWhen beelee needs to secure actions, it will relay the token verification to your application, the token verifier handler will receive one payload map as a param, the map will contain two keys: `token` and `fields`\n\nThe `token` is relayed from your application call to Beelee API so you can verify it with your internal logic\nThe `fields` is a list that will contain the `name` and `email` entries\n\nThe callback should return an {:ok, result} tuple with result being a map with the following atom keys:\n- `user_id`: the user_id in your application\n- `metadata`: an optional map with extra informations\n- `fields`: a map with the requested fields and their value from your application\n\n```elixir\nresult = %{\n  user_id: \"some user_id\",\n  fields: %{\n    name: \"some name\",\n    email: \"some email\"\n  },\n  metadata: %{\n    customer_projects: [\"some id\", \"some other id\"]\n  }\n}\n\n{:ok, result}\n```\n\n### Events\nBeelee communicates with your Business Units through webhooks, all events will be relayed to your Handler module as configured above.\n\nThe `handle_event/1` callback will receive an `%Beeleex.Event{}` struct. Refer to the struct documentation for more details.\n\nYou are free to implement the callback for any event you would like your application to support.\n\nHere is a list of events sent by Beelee with a short description of when this event occurs:\n- `invoice_initiation`: A new cycle runs and invoices were generated for this cycle.\n- `invoice_payment_succeeded`: An invoice has been successfully paid.\n- `invoice_payment_failed`: An invoice payment attempt failed.\n- `payment_method_added`: A new payment method was added to a company.\n- `payment_method_add_failed`: An attempt to add a new payment method to a company failed.\n- `payment_method_expire_2M`: A payment method is set to expire in 2 months.\n- `payment_method_expire_1M`: A payment method is set to expire in 1 month.\n- `payment_method_update`: A payment method has been updated.\n- `payment_method_expiry_1_left`: A payment method expired and there is only one valid method left in the company.\n- `payment_method_expiry_0_left`: The last payment method for this company expired.\n- `company_update`: The company has been updated by the system (e.g becomes insolvent on payment failures or payment method expiration).\n\n### API calls\nTo simplify regular calls to Beelee API the `Beeleex.Api` module expose a set of functions you can call to automate your billing management.\n\nSee the module's documentation for a full list of supported functions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeeks-solutions%2Fbeeleex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeeks-solutions%2Fbeeleex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeeks-solutions%2Fbeeleex/lists"}