{"id":22085592,"url":"https://github.com/nexmo/nexmo-jwt-php","last_synced_at":"2025-08-26T07:13:29.302Z","repository":{"id":43296005,"uuid":"266141408","full_name":"Nexmo/nexmo-jwt-php","owner":"Nexmo","description":"PHP library for creating Nexmo JWTs","archived":false,"fork":false,"pushed_at":"2023-12-19T11:47:00.000Z","size":20,"stargazers_count":0,"open_issues_count":4,"forks_count":4,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-07-23T01:50:09.357Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/Nexmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-22T15:15:11.000Z","updated_at":"2023-07-04T07:31:57.000Z","dependencies_parsed_at":"2022-09-23T11:52:02.546Z","dependency_job_id":null,"html_url":"https://github.com/Nexmo/nexmo-jwt-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Nexmo/nexmo-jwt-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-jwt-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-jwt-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-jwt-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-jwt-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nexmo","download_url":"https://codeload.github.com/Nexmo/nexmo-jwt-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nexmo%2Fnexmo-jwt-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272187881,"owners_count":24888687,"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-26T02:00:07.904Z","response_time":60,"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":"2024-12-01T01:15:11.891Z","updated_at":"2025-08-26T07:13:29.283Z","avatar_url":"https://github.com/Nexmo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"JWT Client Library for PHP \n============================\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)\n[![Build Status](https://api.travis-ci.org/Nexmo/nexmo-jwt-php.svg?branch=main)](https://travis-ci.org/Nexmo/nexmo-jwt-php)\n[![Latest Stable Version](https://poser.pugx.org/nexmo/jwt/v/stable)](https://packagist.org/packages/nexmo/jwt)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)\n[![codecov](https://codecov.io/gh/Nexmo/nexmo-jwt/branch/master/graph/badge.svg)](https://codecov.io/gh/Nexmo/nexmo-jwt)\n\n\u003cimg src=\"https://developer.nexmo.com/assets/images/Vonage_Nexmo.svg\" height=\"48px\" alt=\"Nexmo is now known as Vonage\" /\u003e\n\n*This library requires a minimum PHP version of 7.1*\n\nThis is the PHP library for generating JWTS to use Nexmo's API. To use this, you'll need a Nexmo account. Sign up [for free at \nnexmo.com][signup].\n\n * [Installation](#installation)\n * [Usage](#usage)\n * [Examples](#examples)\n * [Contributing](#contributing) \n\nInstallation\n------------\n\nTo use the client library you'll need to have [created a Nexmo account][signup]. \n\nTo install the PHP client library to your project, we recommend using [Composer](https://getcomposer.org/).\n\n```bash\ncomposer require nexmo/jwt\n```\n\n\u003e You don't need to clone this repository to use this library in your own projects. Use Composer to install it from Packagist.\n\nIf you're new to Composer, here are some resources that you may find useful:\n\n* [Composer's Getting Started page](https://getcomposer.org/doc/00-intro.md) from Composer project's documentation.\n* [A Beginner's Guide to Composer](https://scotch.io/tutorials/a-beginners-guide-to-composer) from the good people at ScotchBox.\n\nUsage\n-----\n\nIf you're using Composer, make sure the autoloader is included in your project's bootstrap file:\n\n```php\nrequire_once \"vendor/autoload.php\";\n```\n\nCreate a Token Generator with the Application ID and Private Key of the Nexmo Application you want to access:\n\n```php\n$generator = new Nexmo\\JWT\\TokenGenerator('d70425f2-1599-4e4c-81c4-cffc66e49a12', file_get_contents('/path/to/private.key'));\n```\n\nYou can then retrieve a generated JWT token by calling the `generate()` method on the Token Generator:\n\n```php\n$token = $generator-\u003egenerate();\n```\n\nThis will return a string token that can be used for Bearer Authentication to Nexmo APIs that require JWTs.\n\nExamples\n--------\n\n### Generating a token with a specific Time To Live\n\nBy default, Nexmo JWT tokens are generated with an Time To Live, or TTL, of 15 minutes after generation. In cases where the token lifetime \nshould be different, you can override this setting by calling the `setTTL()` method on the Token Generator and passing the length of seconds\nthat the token should be valid for\n\n```php\n$generator-\u003esetTTL(30 * 60); // Set expiration to 30 minutes after token creation\n```\n\n### Setting ACLs\n\nNexmo JWTs will default to full access to all of the paths for an application, but this may not be desirable for cases where clients\nmay need restricted access. You can specify the paths that a JWT token is valid for by using the `setPaths()` or `addPath()` methods\nto set the path information in bulk, or add individual paths in a more fluent interface.\n\n```php\n// Set paths in bulk\n$generator-\u003esetPaths([\n    '/*/users/**',\n    '/*/conversations/**'\n]);\n\n// Set paths individually\n$generator-\u003eaddPath('/*/users/**');\n$generator-\u003eaddPath('/*/conversations/**');\n```\n\nFor more information on assigning ACL information, please see [How to generate JWTs\n on the Nexmo Developer Platform](https://developer.nexmo.com/conversation/guides/jwt-acl)\n\nContributing\n------------\n\nThis library is actively developed and we love to hear from you! Please feel free to [create an issue][issues] or [open a pull request][pulls] with your questions, comments, suggestions and feedback.\n\n[signup]: https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL\u0026utm_medium=github\u0026utm_campaign=php-client-library\n[license]: LICENSE.txt\n[issues]: https://github.com/Nexmo/nexmo-jwt-php/issues\n[pulls]: https://github.com/Nexmo/nexmo-jwt-php/pulls\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo%2Fnexmo-jwt-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexmo%2Fnexmo-jwt-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexmo%2Fnexmo-jwt-php/lists"}