{"id":19572351,"url":"https://github.com/linjunpop/app_store","last_synced_at":"2025-04-27T03:33:00.067Z","repository":{"id":57478939,"uuid":"397860143","full_name":"linjunpop/app_store","owner":"linjunpop","description":"👩‍💻 An App Store Server API (StoreKit 2) client in Elixir.","archived":false,"fork":false,"pushed_at":"2024-12-02T10:37:03.000Z","size":59,"stargazers_count":16,"open_issues_count":2,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T15:49:30.832Z","etag":null,"topics":["app-store","app-store-server-api","elixir","storekit"],"latest_commit_sha":null,"homepage":"","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/linjunpop.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-19T07:46:04.000Z","updated_at":"2025-01-24T00:40:18.000Z","dependencies_parsed_at":"2024-06-25T13:27:23.789Z","dependency_job_id":"7e3e1b52-4ea2-442e-8617-d0292f28fcef","html_url":"https://github.com/linjunpop/app_store","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"7fab554f580e99772d2ce611fa12940e6e50c48e"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linjunpop%2Fapp_store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linjunpop%2Fapp_store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linjunpop%2Fapp_store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linjunpop%2Fapp_store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linjunpop","download_url":"https://codeload.github.com/linjunpop/app_store/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251085144,"owners_count":21533821,"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":["app-store","app-store-server-api","elixir","storekit"],"created_at":"2024-11-11T06:26:01.290Z","updated_at":"2025-04-27T03:33:00.054Z","avatar_url":"https://github.com/linjunpop.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# App Store\n\n[App Store Server API](https://developer.apple.com/documentation/appstoreserverapi) client.\n\n## Installation\n\nThe package can be installed\nby adding `app_store` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:app_store, \"~\u003e 0.2.1\"}\n  ]\nend\n```\n\n## Usage\n\nAdd the default HTTP client `AppStore.HTTPClient.DefaultClient` to the application's supervision tree:\n\n```elixir\n# lib/your_app/application.ex\ndef start(_type, _args) do\n  children = [\n    ...\n    {AppStore.HTTPClient.DefaultClient, []}\n  ]\n\n  ...\nend\n```\n\nBuild the client:\n\n```elixir\niex\u003e app_store = AppStore.build()\n\n%AppStore{\n  api_config: %AppStore.API.Config{\n    http_client: AppStore.HTTPClient.DefaultClient,\n    json_coder: AppStore.JSON.DefaultCoder,\n    server_url: \"https://api.storekit.itunes.apple.com\"\n  },\n  token_config: %AppStore.Token.Config{\n    json_coder: AppStore.JSON.DefaultCoder\n  }\n}\n```\n\nGenerate a token:\n\n```elixir\niex\u003e token = AppStore.Token.generate_token(\n  \"57246542-96fe-1a63-e053-0824d011072a\",\n  \"com.example.testbundleid2021\",\n  %{\n    id: \"2X9R4HXF34\",\n    pem: \"-----BEGIN PRIVATE KEY----- ...\"\n  }\n)\n\n\"eyJhbGciOiJFUzI1NiIsImtpZCI6IjJYOVI0SFhGMzQiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJhcHBzdG9yZWNvbm5lY3QtdjEiLCJiaWQiOiJjb20uZXhhbXBsZS50ZXN0YnVuZGxlaWQyMDIxIiwiZXhwIjoxNjI5NTA2MjQwLCJpYXQiOjE2Mjk1MDI3MDAsImlzcyI6IjU3MjQ2NTQyLTk2ZmUtMWE2My1lMDUzLTA4MjRkMDExMDcyYSIsIm5vbmNlIjoiMnFlaWc0a2wxOTQ0aHFhbmVzMDAwMGMxIn0.gYa_A7J6a6UAyBTAohf4gj28jT0k-OX1CW8cwsVGb4EewEm3owdsv6iWvzt7SutCndCBg5hPfNFWuZ0Au20HxA\"\n```\n\nGet transactions history:\n\n```elixir\niex\u003e {:ok, %AppStore.API.Response{body: %{\"signedTransactions\" =\u003e signed_transactions} = body, status: status}} =\n  AppStore.API.get_transaction_history(\n    app_store.api_config,\n    token,\n    \"the-transaction-id\"\n  )\n```\n\nValidate the response:\n\n```elixir\niex\u003e  [\n        {:ok, %JOSE.JWT{fields: %{\"bundleId\" =\u003e \"com.example\", \"environment\" =\u003e \"Sandbox\", \"signedDate\" =\u003e 1_672_956_154_000}}},\n        {:ok, %JOSE.JWT{fields: %{\"bundleId\" =\u003e \"com.example2\", \"environment\" =\u003e \"Sandbox\", \"signedDate\" =\u003e 1_672_956_154_000}}}\n      ] = AppStore.JWSValidation.validate(signed_transactions)\n```\n\nPlease check [https://hexdocs.pm/app_store](https://hexdocs.pm/app_store) for a full documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinjunpop%2Fapp_store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinjunpop%2Fapp_store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinjunpop%2Fapp_store/lists"}