{"id":21657958,"url":"https://github.com/TheRealReal/prismic-elixir","last_synced_at":"2025-07-17T20:32:30.454Z","repository":{"id":28253959,"uuid":"117141148","full_name":"TheRealReal/prismic-elixir","owner":"TheRealReal","description":"Elixir SDK for Prismic.io","archived":false,"fork":false,"pushed_at":"2022-01-20T16:34:14.000Z","size":77,"stargazers_count":10,"open_issues_count":5,"forks_count":9,"subscribers_count":83,"default_branch":"main","last_synced_at":"2023-08-21T21:10:37.203Z","etag":null,"topics":["elixir"],"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/TheRealReal.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":"2018-01-11T19:04:03.000Z","updated_at":"2023-08-21T21:10:37.204Z","dependencies_parsed_at":"2022-08-07T13:15:36.112Z","dependency_job_id":null,"html_url":"https://github.com/TheRealReal/prismic-elixir","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRealReal%2Fprismic-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRealReal%2Fprismic-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRealReal%2Fprismic-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheRealReal%2Fprismic-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheRealReal","download_url":"https://codeload.github.com/TheRealReal/prismic-elixir/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226304202,"owners_count":17603532,"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"],"created_at":"2024-11-25T09:28:24.742Z","updated_at":"2024-11-25T09:28:27.499Z","avatar_url":"https://github.com/TheRealReal.png","language":"Elixir","funding_links":[],"categories":["Elixir"],"sub_categories":[],"readme":"# Prismic ![Build Status Badge](https://github.com/therealreal/prismic-elixir/actions/workflows/ci.yml/badge.svg)\n\nThis is an Elixir-based SDK for Prismic.io\n  Mostly based on https://github.com/prismicio/ruby-kit and https://github.com/prismicio/javascript-kit\n\n  - The primary authors of this library are:\n    1. Coburn Berry ([coburncoburn](https://github.com/coburncoburn))\n      - API\n      - Cache\n      - Predicates\n    2. David Wu ([sudostack](https://github.com/sudostack))\n      - Fragments\n      - Parser\n- TODOs:\n  - [x] Add caching on api entrypoint request ( [Prismic.api/2](https://github.com/TheRealReal/prismic-elixir/blob/master/lib/prismic.ex#L13) )\n  - [ ] Add optional caching on document requests ( [submitting search form](https://github.com/TheRealReal/prismic-elixir/blob/master/lib/prismic.ex#L206) )\n  - [ ] Support authentication in the API\n\n## Installation\n\n```elixir\ndef deps do\n  [\n      {:prismic, git: \"https://github.com/TheRealReal/prismic-elixir\", branch: \"master\"}\n  ]\nend\n```\n\nset repo url in your project's config\n```elixir\n  config :prismic,\n    repo_url: \"https://micro.cdn.prismic.io/api\"\n```\n\n## Usage\n\n```elixir\nPrismic.V2.API.new()\n|\u003e SearchForm.from_api()\n|\u003e SearchForm.set_ref(\u003cref\u003e) # master ref / versioned ref\n|\u003e SearchForm.set_query_predicates([Predicate.at(\"document.id\", \u003cid\u003e)])\n|\u003e SearchForm.submit()\n|\u003e Map.fetch!(:results)\n|\u003e Parser.parse_documents() # %Prismic.Document{id: ..., uid: ..., href: ..., fragments...}\n\n```\n## Configuring HTTP Client\nThe default HTTP Client is Poison. It is possible to use any http client that implements the [ Prismic.HTTPClient behaviour ](https://github.com/therealreal/prismic-elixir/blob/master/lib/http_client.ex#L1).\n\nThen, set the HTTPClient Module in config or within\n```\n    Application.put_env(:prismic, :http_client_module, MyApp.HTTPClient)\n```\n\n## Configuring Cache\nThe default Cache is an [ Agent ](https://github.com/therealreal/prismic-elixir/blob/master/lib/cache.ex#L23). It is possible to use any cache that implements the [ Prismic.Cache behaviour ](https://github.com/therealreal/prismic-elixir/blob/master/lib/cache.ex#L1).\n\nThen, set the Cache Module in config or within\n```\n    Application.put_env(:prismic, :cache_module, MyApp.Cache)\n```\n\nOnly the first leg of the request ( api entrypoint ) is cached. Actual document queries are not cached. It is probably better to just cache calls to the library itself rather than worrying about caching in the library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheRealReal%2Fprismic-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTheRealReal%2Fprismic-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTheRealReal%2Fprismic-elixir/lists"}