{"id":26893350,"url":"https://github.com/saiqulhaq/firebase_dynamic_link","last_synced_at":"2025-05-12T15:44:00.593Z","repository":{"id":31864069,"uuid":"129874995","full_name":"saiqulhaq/firebase_dynamic_link","owner":"saiqulhaq","description":"Ruby client for Firebase Dynamic Links Shortener","archived":false,"fork":false,"pushed_at":"2023-09-04T19:04:48.000Z","size":396,"stargazers_count":16,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-01T00:39:43.464Z","etag":null,"topics":["firebase","firebase-dynamic-links","link-shortener","ruby","shorten-urls","shorturl","shorturl-services"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/saiqulhaq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-04-17T08:51:17.000Z","updated_at":"2023-05-16T15:45:45.000Z","dependencies_parsed_at":"2025-03-30T14:40:57.884Z","dependency_job_id":null,"html_url":"https://github.com/saiqulhaq/firebase_dynamic_link","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiqulhaq%2Ffirebase_dynamic_link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiqulhaq%2Ffirebase_dynamic_link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiqulhaq%2Ffirebase_dynamic_link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saiqulhaq%2Ffirebase_dynamic_link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saiqulhaq","download_url":"https://codeload.github.com/saiqulhaq/firebase_dynamic_link/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253767428,"owners_count":21961107,"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":["firebase","firebase-dynamic-links","link-shortener","ruby","shorten-urls","shorturl","shorturl-services"],"created_at":"2025-03-31T23:46:35.535Z","updated_at":"2025-05-12T15:44:00.555Z","avatar_url":"https://github.com/saiqulhaq.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maintainability](https://api.codeclimate.com/v1/badges/0e2629515335c72ef80d/maintainability)](https://codeclimate.com/github/saiqulhaq/firebase_dynamic_link/maintainability)\n[![Audit](https://github.com/saiqulhaq/firebase_dynamic_link/actions/workflows/audit.yml/badge.svg)](https://github.com/saiqulhaq/firebase_dynamic_link/actions/workflows/audit.yml)\n[![Test](https://github.com/saiqulhaq/firebase_dynamic_link/actions/workflows/test.yml/badge.svg)](https://github.com/saiqulhaq/firebase_dynamic_link/actions/workflows/test.yml)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/0e2629515335c72ef80d/test_coverage)](https://codeclimate.com/github/saiqulhaq/firebase_dynamic_link/test_coverage)\n\nFirebase Dynamic Link is a tool to create a deep link of your webpage. It can be a tool to create a short link like Bit.ly too\n\n- [Setup](#setup)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Configure the HTTP client](#configure-the-http-client)\n  - [Shorten a link](#shorten-a-link)\n  - [Shorten parameters](#shorten-parameters)\n  - [More than one firebase project](#more-than-one-firebase-project)\n- [CHANGELOG](#changelog)\n- [Development](#development)\n- [Contributing](#contributing)\n- [License](#license)\n- [Code of Conduct](#code-of-conduct)\n\n\n## Setup\n\nBefore you begin, you need to register at Firebase, and find following data:\n1. Firebase API key\n\n   Open Open the Settings page of the Firebase console. If you are prompted to choose a project, select your Firebase project from the menu. The API key is a Web API Key field, you need to a note this key.\n2. Dynamic Links domain\n\n   In the Firebase console, open the Dynamic Links section, accept the terms of service if prompted, and copy the dynamic links host.\n   Usually it's like `https://xxx.page.link`. You can use your own custom domain to make it shorter. Reference: https://firebase.google.com/docs/dynamic-links/custom-domains\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'firebase_dynamic_link'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install firebase_dynamic_link\n\n## Usage\n\n### Configure the HTTP client\n\n```ruby\n    FirebaseDynamicLink.configure do |config|\n      # the adapter should be supported by Faraday\n      # more info look at https://github.com/lostisland/faraday/tree/master/test/adapters\n      # Faraday.default_adapter is the default adapter\n      config.adapter = :httpclient # optional, default is net_http\n\n      # required, taken as default firebase api key when api_key parameter isn't passed to FirebaseDynamicLink::Client constructor\n      config.api_key = 'API_KEY'\n\n      # default 'UNGUESSABLE'\n      config.suffix_option = 'SHORT' or 'UNGUESSABLE'\n\n      # required\n      config.dynamic_link_domain = 'https://xyz.app.goo.gl'\n\n      # default 3 seconds\n      config.timeout = 3\n\n      # default 3 seconds\n      config.open_timeout = 3\n    end\n```\n\n### Shorten a link\nThis method shortens a link with up to the first parameter in tact. Use this method if you do not have more than one\nparameter in the URL. Shortening an URL with more than one parameters will result in truncation of parameters after the\nfirst one.\n\n```ruby\n    client = FirebaseDynamicLink::Client.new\n    link = \"http://domain.com/path/path\"\n    options = {\n      # optional, to override default suffix default config\n      suffix_option: '',\n\n      # optional, to override default dynamic_link_domain default config\n      dynamic_link_domain: '',\n\n      # optional, timeout of each request of this instance\n      timeout: 10,\n\n      # optional, open timeout of each request of this instance\n      open_timeout: 10\n    }\n\n    # options argument is optional\n    result = client.shorten_link(link, options)\n```\n\n### Shorten parameters\nThis method allows shortening of an URL with multiple parameters.\n\n```ruby\n    client = FirebaseDynamicLink::Client.new\n    link = \"http://domain.com/path/path?key1=value1\u0026key2=val2\u0026key3=val3\"\n    options = {\n      # optional, to override default suffix default config\n      suffix_option: '',\n\n      # optional, to override default dynamic_link_domain default config\n      dynamic_link_domain: '',\n\n      # optional, timeout of each request of this instance\n      timeout: 10,\n\n      # optional, open timeout of each request of this instance\n      open_timeout: 10\n    }\n\n    parameters = {\n      link: link,\n      android_info: {\n        android_package_name: name,\n      },\n      ios_info: {},\n      navigation_info: {},\n      analytics_info: {},\n      social_meta_tag_info: {}\n    }\n\n    # options argument is optional\n    result = client.shorten_parameters(parameters, options)\n```\n\nIf request successful, then the result should be like following hash object\n\nOr if the request reached daily quota, client will throw `FirebaseDynamicLink::QuotaExceeded` error\n\n```ruby\n    {\n      :link=\u003e\"https://--.app.goo.gl/ukph\",\n      :preview_link=\u003e\"https://--.app.goo.gl/ukph?d=1\",\n      :warning=\u003e[\n           {\n             \"warningCode\"=\u003e\"UNRECOGNIZED_PARAM\",\n             \"warningMessage\"=\u003e\"...\"\n           },\n           {\n             \"warningCode\"=\u003e\"...\"\n           },\n           {\n             \"warningCode\"=\u003e\"...\"\n           }\n        ]\n    }\n```\n\nOtherwise it will throw `FirebaseDynamicLink::ConnectionError` error, with message = http error message\n\n### More than one firebase project\n\nIf you have more than one firebase project you can pass your `api_key` to `FirebaseDynamicLink::Client` constructor additionally to `FirebaseDynamicLink` configuration.\nApi key provided by constructor has precendece over this provided by `FirebaseDynamicLink` configuration.\n\n```\n    client = FirebaseDynamicLink::Client.new(api_key: 'API_KEY')\n```\n\n\n## CHANGELOG\n\nSee https://github.com/saiqulhaq/firebase_dynamic_link/releases\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies.\nCopy `.env.template` to `.env` and update the values.\nThen, run `bundle exec appraisal install \u0026\u0026 bundle exec appraisal rspec` to run the tests.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/saiqulhaq/firebase_dynamic_link. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the FirebaseDynamicLink project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/saiqulhaq/firebase_dynamic_link/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaiqulhaq%2Ffirebase_dynamic_link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaiqulhaq%2Ffirebase_dynamic_link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaiqulhaq%2Ffirebase_dynamic_link/lists"}