{"id":21826447,"url":"https://github.com/malomohq/shopify-oauth-elixir","last_synced_at":"2025-04-14T05:24:39.189Z","repository":{"id":48281904,"uuid":"240538022","full_name":"malomohq/shopify-oauth-elixir","owner":"malomohq","description":"Elixir client for the Shopify OAuth API","archived":false,"fork":false,"pushed_at":"2021-08-03T14:27:12.000Z","size":81,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T19:14:46.755Z","etag":null,"topics":["elixir-lang","made-by-malomo","shopify","shopify-api","shopify-apps","shopify-oauth"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/shopify_oauth","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/malomohq.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}},"created_at":"2020-02-14T15:23:07.000Z","updated_at":"2021-12-12T17:59:03.000Z","dependencies_parsed_at":"2022-09-26T18:40:59.812Z","dependency_job_id":null,"html_url":"https://github.com/malomohq/shopify-oauth-elixir","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/malomohq%2Fshopify-oauth-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malomohq%2Fshopify-oauth-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malomohq%2Fshopify-oauth-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malomohq%2Fshopify-oauth-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malomohq","download_url":"https://codeload.github.com/malomohq/shopify-oauth-elixir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248825584,"owners_count":21167512,"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-lang","made-by-malomo","shopify","shopify-api","shopify-apps","shopify-oauth"],"created_at":"2024-11-27T18:04:09.855Z","updated_at":"2025-04-14T05:24:39.183Z","avatar_url":"https://github.com/malomohq.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shopify.OAuth\n\n## Installation\n\n`Shopify.OAuth` is published on [Hex](https://hex.pm/packages/shopify_oauth).\nAdd it to your list of dependencies in `mix.exs`;\n\n```elixir\ndefp deps do\n  { :shopify_oauth, \"~\u003e 1.0\" }\nend\n```\n\n`Shopify.OAuth` requires you to provide an HTTP client and a JSON codec.\n`hackney` and `jason` are used by default. If you wish to use these defaults you\nwill need to specify `hackney` and `jason` as dependencies as well.\n\n## Usage\n\n```elixir\n{:ok, response} =\n  %{client_id: \"49f754092e83a76bf4e49ab6feb3f8b9\", client_secret: \"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\", code: \"f5be881c575fedf9491d26aff123ace7\"}\n  |\u003e Shopify.OAuth.create_access_token()\n  |\u003e Shopify.OAuth.request(%{shop: \"some-shop\"})\n```\n\n### Verifying HMAC Signatures\n\n`Shopify.OAuth` provides `verify_hmac/2` and `verify_hmac/3` functions for\nverifying HMAC signatures returned by the Shopify API.\n\nPlease see the Shopify [Authentication with OAuth](https://shopify.dev/tutorials/authenticate-with-oauth#verification)\ndocumentation for the technical details regarding HMAC verification.\n\n**`verify_hmac/2`**\n\n```elixir\nquery = \"code=0907a61c0c8d55e99db179b68161bc00\u0026hmac=700e2dadb827fcc8609e9d5ce208b2e9cdaab9df07390d2cbca10d7c328fc4bf\u0026shop=some-shop.myshopify.com\u0026state=0.6784241404160823\u0026timestamp=1337178173\"\nshared_secret = \"hush\"\n\n{:ok, hmac} = Shopify.OAuth.verify_hmac(query, shared_secret)\n```\n\n**`verify_hmac/3`**\n\n```elixir\nhmac = \"700e2dadb827fcc8609e9d5ce208b2e9cdaab9df07390d2cbca10d7c328fc4bf\"\nmessage = \"code=0907a61c0c8d55e99db179b68161bc00\u0026shop=some-shop.myshopify.com\u0026timestamp=1337178173\"\nshared_secret = \"hush\"\n\n{:ok, hmac} = Shopify.OAuth.verify_hmac(hmac, message, shared_secret)\n```\n\n## Configuration\n\nConfiguration is passed as a map to the second argument of\n`Shopify.OAuth.request/2`.\n\n* `:host` - HTTP host to make requests to. Defaults to `myshopify.com`.\n* `:http_client` - the HTTP client used for making requests. Defaults to\n  `Shopify.OAuth.Client.Hackney`.\n* `:http_client_opts` - additional options passed to `:http_client`. Defaults to\n  `[]`.\n* `:json_codec` - codec for encoding and decoding JSON payloads. Defaults to\n  `Jason`.\n* `:path` - path to prefix on each request. Defaults to `/admin`.\n* `:port` - the HTTP port used when making a request\n* `:protocol` - the HTTP protocol used when making a request. Defaults to\n  `https`.\n* `:retry` - whether to automatically retry failed API calls. May be `true` or\n  `false`. Defaults to `false`.\n* `:retry_opts` - options used when performing retries. Defaults to `[]`.\n  * `:max_attempts` - the maximum number of retry attempts. Defaults to `3`.\n* `:shop` - subdomain of the shop that a request is to be made to\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalomohq%2Fshopify-oauth-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalomohq%2Fshopify-oauth-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalomohq%2Fshopify-oauth-elixir/lists"}