{"id":24623688,"url":"https://github.com/moomerman/stytch-elixir","last_synced_at":"2025-08-20T18:24:09.992Z","repository":{"id":63054386,"uuid":"564944198","full_name":"moomerman/stytch-elixir","owner":"moomerman","description":"An Elixir API client for Stytch","archived":false,"fork":false,"pushed_at":"2024-10-17T08:23:45.000Z","size":56,"stargazers_count":8,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-10T19:23:21.932Z","etag":null,"topics":[],"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/moomerman.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,"zenodo":null}},"created_at":"2022-11-11T22:01:25.000Z","updated_at":"2025-02-20T22:07:59.000Z","dependencies_parsed_at":"2025-05-07T16:26:24.311Z","dependency_job_id":null,"html_url":"https://github.com/moomerman/stytch-elixir","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"1d72a6789429d073971fff531fce0addc00ce380"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moomerman/stytch-elixir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moomerman%2Fstytch-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moomerman%2Fstytch-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moomerman%2Fstytch-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moomerman%2Fstytch-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moomerman","download_url":"https://codeload.github.com/moomerman/stytch-elixir/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moomerman%2Fstytch-elixir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271362552,"owners_count":24746503,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"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":"2025-01-25T03:57:56.534Z","updated_at":"2025-08-20T18:24:09.939Z","avatar_url":"https://github.com/moomerman.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stytch\n\nAn Elixir API client for [Stytch](https://stytch.com/docs/api)\n\n## Installation\n\nThe package can be installed by adding `stytch` to your list of\ndependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:stytch, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Configuration\n\nTo make API calls you need to configure your Stytch `project_id` and `secret`.\n\nIf you set the `STYTCH_PROJECT_ID` and `STYTCH_SECRET` environment variables\nthen they will be used.\n\nYou can also override the configuration in your application config:\n\n```elixir\nconfig :stytch,\n  project_id: \"my-project-id\",\n  secret: \"my-secret\"\n```\n\nThe default endpoint for API requests is https://test.stytch.com/v1 and in\nprod environments is https://api.stytch.com/v1 but these can be\noverridden by the `STYTCH_ENDPOINT` environment variable or `:endpoint`\nconfig option.\n\n## Documentation\n\nThe package docs can be found at \u003chttps://hexdocs.pm/stytch\u003e.  \n\nThe full Stytch API documentation can be found at \u003chttps://stytch.com/docs/api\u003e.\n\n## Examples\n\nThese examples use sandbox values provided by Stytch so will return a valid\nresponse but won't actually send anything.\n\n### Magic Links\n\n```elixir\nStytch.send_magic_link_by_email(\"sandbox@stytch.com\")\n\n{:ok,\n %{\n   email_id: \"email-test-23873e89-d4ed-4e92-b3b9-e5c7198fa286\",\n   request_id: \"request-id-test-66d49012-2b36-4835-9093-2a51f4ba3570\",\n   status_code: 200,\n   user_id: \"user-test-e3795c81-f849-4167-bfda-e4a6e9c280fd\"\n }}\n```\n\n```elixir\nStytch.authenticate_magic_link(\"DOYoip3rvIMMW5lgItikFK-Ak1CfMsgjuiCyI7uuU94=\")\n```\n\n### One-time Passcodes (OTP)\n\n```elixir\nStytch.send_otp_by_sms(\"+10000000000\")\n```\n\n### Sessions\n\n```elixir\nStytch.authenticate_session(\"WJtR5BCy38Szd5AfoDpf0iqFKEt4EE5JhjlWUY7l3FtY\")\n```\n\n### Time-based one-time passcodes (TOTP)\n\n```elixir\nStytch.create_totp(\"user-test-e3795c81-f849-4167-bfda-e4a6e9c280fd\")\n```\n\n## Handling errors\n\nSuccesful API calls return a `{:ok, map()}` response.\n\nIf the API returns an error you'll get a `{:error, map()}` response with \nthe error information:\n\n```elixir\nStytch.authenticate_session(\"INVALID\")\n\n{:error,\n %{\n   error_message: \"Session token format is invalid.\",\n   error_type: \"invalid_session_token\",\n   error_url: \"https://stytch.com/docs/api/errors/400\",\n   request_id: \"request-id-test-f64acf06-8a0a-4b45-9fbd-bfc3b5ca7f50\",\n   status_code: 400\n }}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoomerman%2Fstytch-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoomerman%2Fstytch-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoomerman%2Fstytch-elixir/lists"}