{"id":15957239,"url":"https://github.com/mamantoha/vk_auth","last_synced_at":"2026-05-19T06:05:36.946Z","repository":{"id":44806217,"uuid":"428961706","full_name":"mamantoha/vk_auth","owner":"mamantoha","description":"Crystal library for getting Vk Access Token without manually accessing vk.com website from the browser","archived":false,"fork":false,"pushed_at":"2024-08-13T08:06:07.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-12T01:34:11.098Z","etag":null,"topics":["crystal","vk","vkontakte"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/mamantoha.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-17T08:17:55.000Z","updated_at":"2024-08-13T08:06:10.000Z","dependencies_parsed_at":"2024-06-03T13:03:01.201Z","dependency_job_id":"43260e80-04b5-42b5-9fc5-f3a2774dc263","html_url":"https://github.com/mamantoha/vk_auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mamantoha/vk_auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fvk_auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fvk_auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fvk_auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fvk_auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mamantoha","download_url":"https://codeload.github.com/mamantoha/vk_auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fvk_auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33204093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"online","status_checked_at":"2026-05-19T02:00:06.763Z","response_time":58,"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":["crystal","vk","vkontakte"],"created_at":"2024-10-07T13:41:07.066Z","updated_at":"2026-05-19T06:05:36.932Z","avatar_url":"https://github.com/mamantoha.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vk:Auth\n\n[![Crystal CI](https://github.com/mamantoha/vk_auth/actions/workflows/crystal.yml/badge.svg?branch=main)](https://github.com/mamantoha/vk_auth/actions/workflows/crystal.yml)\n\nCrystal library for getting an [Access Token](https://vk.com/dev/access_token) without manually accessing [vk.com](https://vk.com) website from the browser.\n\n`access_token` is needed to run most [Vk API requests](https://vk.com/dev/api_requests).\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     vk_auth:\n       github: mamantoha/vk_auth\n   ```\n\n2. Run `shards install`\n\n## Usage\n\n```crystal\nrequire \"vk_auth\"\n```\n\n## Getting a Token\n\nThis library supports the [Implicit flow](https://vk.com/dev/implicit_flow_user) way to obtain an OAuth 2.0 access token.\n\nThe `Vk::Auth` constructor takes one argument - the Vk application ID.\n\n```crystal\nclient = Vk::Auth.new(client_id)\n```\n\nThe `#get_token` method takes the following arguments:\n\n- `email`: user login\n- `password`: user password\n- `permissions`: request [application permissions](https://vk.com/dev/permissions)\n\n```crystal\nclient.get_token(email, password, permissions: [\"friends\"])\n```\n\nAfter successful authorization, you can access `#access_token`:\n\n```crystal\nif client.authorized?\n  client.access_token # =\u003e NamedTuple(access_token: String, expires_in: String, user_id: String)\n  access_token = client.token.not_nil![\"access_token\"]\nend\n```\n\n## API requests\n\n\u003e Note, this shard doesn't provide the functionality to make API requests.\n\nYou can use previously obtained `access_token` to make API requests.\n\nFor example:\n\n```crystal\nrequire \"http/client\"\n\naccess_token = \"user-access-token\"\nmethod_name = \"users.get\"\nparameters = \"fields=bdate,city,country\"\nversion = \"5.131\"\nlang = \"en\"\n\nurl = \"https://api.vk.com/method/#{method_name}?#{parameters}\u0026access_token=#{access_token}\u0026v=#{version}\u0026lang=#{lang}\"\n\nresp = HTTP::Client.get(url)\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/mamantoha/vk_auth/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Anton Maminov](https://github.com/your-github-user) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamantoha%2Fvk_auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmamantoha%2Fvk_auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamantoha%2Fvk_auth/lists"}