{"id":34016993,"url":"https://github.com/openpeeps/webtokens","last_synced_at":"2026-06-09T09:31:41.606Z","repository":{"id":326357095,"uuid":"1104756247","full_name":"openpeeps/webtokens","owner":"openpeeps","description":"Nim Bindings for LibJWT - JSON Web Token Library +JWK +JWKS","archived":false,"fork":false,"pushed_at":"2025-11-27T10:46:55.000Z","size":120,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-15T02:33:57.022Z","etag":null,"topics":["json-web-token","jwe","jws","jwt","jwt-token","libjwt","nim","nim-lang","webtoken"],"latest_commit_sha":null,"homepage":"https://openpeeps.github.io/webtokens/","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openpeeps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-26T16:37:53.000Z","updated_at":"2025-12-09T21:47:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/openpeeps/webtokens","commit_stats":null,"previous_names":["openpeeps/webtokens"],"tags_count":1,"template":false,"template_full_name":"openpeeps/pistachio","purl":"pkg:github/openpeeps/webtokens","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpeeps%2Fwebtokens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpeeps%2Fwebtokens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpeeps%2Fwebtokens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpeeps%2Fwebtokens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openpeeps","download_url":"https://codeload.github.com/openpeeps/webtokens/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpeeps%2Fwebtokens/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34101065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":["json-web-token","jwe","jws","jwt","jwt-token","libjwt","nim","nim-lang","webtoken"],"created_at":"2025-12-13T14:18:11.575Z","updated_at":"2026-06-09T09:31:41.600Z","avatar_url":"https://github.com/openpeeps.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://www.jwt.io/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fjwt-flower.f20616b0.png\u0026w=1920\u0026q=75\" width=\"48px\" height=\"48px\" alt=\"JWT Logo\"\u003e\u003cbr\u003e\n  👑 Nim lang bindings for LibJWT\u003cbr\u003e\n  JSON Web Token Library\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ccode\u003enimble install webtokens\u003c/code\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://openpeeps.github.io/webtokens/\"\u003eAPI reference\u003c/a\u003e\u003cbr\u003e\n  \u003cimg src=\"https://github.com/openpeeps/webtokens/workflows/test/badge.svg\" alt=\"Github Actions\"\u003e  \u003cimg src=\"https://github.com/openpeeps/webtokens/workflows/docs/badge.svg\" alt=\"Github Actions\"\u003e\n\u003c/p\u003e\n\n## About\nThis package provides Nim bindings for [LibJWT](https://github.com/benmcollins/libjwt), a C library that supports the following standards JWS, JWE, JWK, JWA and JWTs. It allows you to create, sign, verify, and decode JSON Web Tokens in your Nim applications.\n\n\u003e [!NOTE]\n\u003e 👌 **Low-level** and **high-level APIs** are provided to work with JWTs, JWKs, and JWS/JWE tokens.\n\n### Prerequisites\nCheck the official [LibJWT installation guide](https://github.com/benmcollins/libjwt?tab=readme-ov-file#construction-build-prerequisites)\n\n\n## Examples\nHere is a simple example demonstrating how to create and sign a JSON Web Token (JWT) using HMAC SHA-256 algorithm with the `webtokens` Nim package.\n\n### Create and Sign a Json Web Token\n```nim\n{.passL:\"-L/opt/local/lib -ljwt\", passC:\"-I /opt/local/include\".}\n\nimport std/[times, json]\nimport webtokens\n\n# Generate a JWK Set with one random HMAC (oct) key\nlet jwksJson = generateJwkSet(1, 32)\n\nlet set = loadJwkSetFromJson($jwksJson)\nlet key = set.findByKid(\"hmac-key-0\")\nlet alg = parseAlg(\"HS256\")\n\n# Initialize JWT Builder\nvar builder = newJwtBuilder()\nbuilder.setKey(alg, key)\n\nbuilder.setHeader(\"typ\", \"JWT\")\nbuilder.setHeader(\"kid\", key.itemKid())\nbuilder.setIss(\"example-app\")\nbuilder.setSub(\"user123\")\n\nbuilder.setExpIn(3600) # token expires in 1 hour\n\n# Generate the token\nlet token = builder.generate()\necho \"Generated JWT: \", token\n\n# Now, you can use this token for authentication/authorization\nvar verifier = newJwtChecker()\nverifier.setKey(alg, key)\nverifier.setLeeway(JWT_CLAIM_EXP, 5) # small clock skew\n\nif verifier.verify(token):\n  echo \"Verified OK!\"\n```\n\n_todo more examples_\n\n### ❤ Contributions \u0026 Support\n- 🐛 Found a bug? [Create a new Issue](https://github.com/openpeeps/webtokens/issues)\n- 👋 Wanna help? [Fork it!](https://github.com/openpeeps/webtokens/fork)\n- 😎 [Get €20 in cloud credits from Hetzner](https://hetzner.cloud/?ref=Hm0mYGM9NxZ4)\n\n### 🎩 License\nMade by [Humans from OpenPeeps](https://github.com/openpeeps).\u003cbr\u003e\nCopyright OpenPeeps \u0026 Contributors \u0026mdash; All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenpeeps%2Fwebtokens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenpeeps%2Fwebtokens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenpeeps%2Fwebtokens/lists"}