{"id":15773995,"url":"https://github.com/verifykit/verifykit-sdk-php","last_synced_at":"2025-06-11T16:32:33.529Z","repository":{"id":53715651,"uuid":"220185786","full_name":"verifykit/verifykit-sdk-php","owner":"verifykit","description":"Verifykit SDK for PHP","archived":false,"fork":false,"pushed_at":"2024-03-26T14:21:51.000Z","size":55,"stargazers_count":25,"open_issues_count":2,"forks_count":13,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-21T14:05:10.998Z","etag":null,"topics":["otp","phone","phone-number","phone-numbers","php","sdk","sms-verification","telegram","verification","verify","verifykit","whatsapp","whatsapp-api"],"latest_commit_sha":null,"homepage":"https://verifykit.com","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/verifykit.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":"2019-11-07T08:20:23.000Z","updated_at":"2024-11-22T14:55:37.000Z","dependencies_parsed_at":"2024-10-25T20:09:00.495Z","dependency_job_id":"278ef0ef-1ee6-40b3-a746-f8ea0f2367e5","html_url":"https://github.com/verifykit/verifykit-sdk-php","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":0.08333333333333337,"last_synced_commit":"a0fceba9cc3e5dff8c6a55a1b01ebb42c97b08b5"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/verifykit/verifykit-sdk-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verifykit%2Fverifykit-sdk-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verifykit%2Fverifykit-sdk-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verifykit%2Fverifykit-sdk-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verifykit%2Fverifykit-sdk-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/verifykit","download_url":"https://codeload.github.com/verifykit/verifykit-sdk-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verifykit%2Fverifykit-sdk-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259297796,"owners_count":22836434,"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":["otp","phone","phone-number","phone-numbers","php","sdk","sms-verification","telegram","verification","verify","verifykit","whatsapp","whatsapp-api"],"created_at":"2024-10-04T16:04:21.860Z","updated_at":"2025-06-11T16:32:33.471Z","avatar_url":"https://github.com/verifykit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VerifyKit\n![Status](https://img.shields.io/badge/Status-Beta-yellowgreen) ![License](https://img.shields.io/badge/License-MIT-red.svg)\n\nVerifyKit is the next gen phone number validation system. Users can easily verify their  phone numbers without the need of entering phone number or a pin code.\n\n*This SDK is a tool for you to use the [VerifyKit Rest API](https://github.com/verifykit/verifykit-sdk-php/blob/master/API.md) more easily.*\n\n## Requirements\n\n - PHP \u003e= 5.5\n - PHP-Curl\n - PHP-Json\n\n## Installation\n\nYou can install via composer\n\n```bash\ncomposer require verifykit/verifykit-sdk-php\n```\n\n## Usage\n\n### IMPORTANT NOTE\n\nFor the security of your application, you should send the IP address of the end user in all requests. To do this, you need to set $clientIp parameter in all class constructions.\n\n#### Validation Method List\n\nFirstly, get a list of validation methods.\n\n```php\n$vfk = new \\VerifyKit\\Web($serverKey, $clientIp);\n\n/** @var \\VerifyKit\\Entity\\ValidationMethodList $validationMethodList */\n$validationMethodList = $vfk-\u003egetValidationMethodList();\n\n/** @var \\VerifyKit\\Entity\\ValidationMethod $validationMethod */\nforeach ($validationMethodList-\u003egetList() as $validationMethod) {\n    // $validationMethod-\u003e getName, getApp, getText, getTextColour, getBgColour, getIcon...\n}\n\n// if you want to handle all localizations for validation steps, use this way.\n/** @var \\VerifyKit\\Entity\\Localization $localization */\nforeach ($validationMethodList-\u003egetLocalizationList() as $localization){\n    // getKey, getValue of localization.\n}\n```\n\n#### Start Validation (WhatsApp or Telegram)\n\n```php\n$vfk = new \\VerifyKit\\Web($serverKey, $clientIp);\n\n$validationMethod = 'whatsapp'; // or telegram. Required.\n\n$lang = 'en'; // Language of end user. Default value is 'en' (English). This parameter is not required.   \n\n// We can give both deeplink and qrCode in response to the start request. If you send qrCode parameter as (bool)true, you can see that you have received a base64 qrCode. By showing this qrCode to users coming from desktop browsers, you can make it easier to verify.\n// We recommend that you do not send qrCode parameter as (bool)true for requests from mobile applications or mobile browsers. You should use deeplink for these platforms.\n// This two parameters cannot be (bool)true at the same time. If you send both (bool)true at the same time, we will only give the deeplink in the response.\n// Default value is true for deeplink, and false for qrCode. These parameters are not required.\n$deeplink = true;\n$qrCode = false;\n\n/** @var \\VerifyKit\\Entity\\ValidationStart $result */\n$validationStart = $vfk-\u003estartValidation($validationMethod, $lang, $deeplink, $qrCode);\n\n// if you want to redirect your user for validation, get deeplink.\necho $validationStart-\u003egetDeeplink();\n\n// if you want to view a Qr code to your user for validation, get base64 png string and set it as an image source on web browsers.\necho $validationStart-\u003egetQrCode();\n\n// keep this reference code for next step.\necho $validationStart-\u003egetReference();\n```\n\n#### Check Validation (WhatsApp or Telegram)\n\n```php\n$vfk = new \\VerifyKit\\Web($serverKey, $clientIp);\n\n$reference = \"111111\"; // reference from startValidation step.\n\n/** @var \\VerifyKit\\Entity\\ValidationCheck $validation */\n$validationCheck = $vfk-\u003echeckValidation($reference);\nif ($validationCheck-\u003egetValidationStatus()) {\n    $sessionId = $validationCheck-\u003egetSessionId(); // session id for the validation result\n    $appPlatform = $validationCheck-\u003egetAppPlatform(); // web, android or ios\n}\n```\n\n#### Start Validation (OTP)\n\n##### Country List\n\nWe recommend that users should choose their country before typing their numbers in order to avoid confusion about the country code. For this reason, it may be helpful to get the country list before OTP verifications.\n\n```php\n$vfk = new \\VerifyKit\\Web($serverKey, $clientIp);\n\n$countryCode = \"TR\"; // country code parameter for the request. We return the sent countryCode parameter at the top of the list in the response. If you want a specific country (user's country detected by ip on your side for example) to be the first response parameter, you can send $countryCode with your request. Not required.\n\n$result = $vfk-\u003egetCountryList($countryCode);\n\n/** @var \\VerifyKit\\Entity\\Country $country */\nforeach ($result-\u003egetCountryList() as $country){\n    echo $country-\u003egetPhoneCode(); // phone code.\n    echo $country-\u003egetCountryCode(); // country code\n    echo $country-\u003egetTitle(); // country name\n}\n\n```\n\nThen, start an OTP validation \n\n```php\n$vfk = new \\VerifyKit\\Web($serverKey, $clientIp);\n\n$phoneNumber = '+90........'; // End user phone number. Required.\n\n$countryCode = 'TR'; // Country code of the end user's phone number. This parameter should exist in the country list request's response array as only the listed countries could be used for OTP validations. Required.\n\n// For OTP verification to work best, you should send us the MCC and MNC code of the sim card in the user's device.\n$mcc = '999'; // Mobile Country Code (MCC) of the sim card in the user's device. Default value is '999'. Not required.\n$mnc = '999'; // Mobile Network Code (MNC) of the sim card in the user's device. Default value is '999'. Not required.\n\n$lang = 'en'; // Language of end user. Default value is 'en' (English). You can set the language of the sent message. This parameter is not required.   \n\n\n/** @var \\VerifyKit\\Entity\\OTPSend $result */\n$result = $vfk-\u003esendOTP($phoneNumber, $countryCode, $mcc, $mnc, $lang);\n\n$reference = $result-\u003egetReference(); // This parameter is required for a check OTP request.\n\n```\n\n#### Check Validation (OTP)\n\n$phoneNumber, $countryCode, $reference, $code\n\n```php\n$vfk = new \\VerifyKit\\Web($serverKey, $clientIp);\n\n$phoneNumber = '+90........'; // End user phone number. Required.\n\n$countryCode = 'TR'; // Country code of the end user's phone number. This parameter should exist in the country list request's response array as only the listed countries could be used for OTP vadlidations. Required.\n\n$reference = \"111111\"; // reference from sendOtp step. Required.\n\n$code = \"123456\"; // The code to be entered by the user receiving the OTP.\n\n/** @var \\VerifyKit\\Entity\\OtpCheck $validation */\n$otpCheck = $vfk-\u003echeckOtp($phoneNumber, $countryCode, $reference, $code);\nif ($otpCheck-\u003egetValidationStatus()) {\n    $sessionId = $otpCheck-\u003egetSessionId(); // session id for the OTP validation result\n}\n```\n\n#### Complete Validation\n\nFinally, get result by session id.\n\n```php\n$vfk = new \\VerifyKit\\VerifyKit($serverKey, $clientIp);\n\n/** @var \\VerifyKit\\Entity\\Response $result */\n$result = $vfk-\u003egetResult($sessionId);\n\nif ($result-\u003eisSuccess()) {\n    echo \"Phone number : \" . $result-\u003egetPhoneNumber() .\n        \", Validation Type : \" . $result-\u003egetValidationType() .\n        \", Validation Date : \" . $result-\u003egetValidationDate()-\u003eformat('Y-m-d H:i:s') . PHP_EOL;\n} else {\n    echo \"Error message : \" . $result-\u003egetErrorMessage() . \", error code : \" . $result-\u003egetErrorCode() . PHP_EOL;\n}\n```\n\n\n#### WhatsApp Session Message\n\nIf you want to send messages to your verified users within 24 hours with WhatsApp Session Message, you can use this way.\n \n```php\n$waMessage = new \\VerifyKit\\WASessionMessage($serverKey, $clientIp);\n\n\n/** @var \\VerifyKit\\Entity\\WAMessageResponse $result */\n$result = $waMessage-\u003esendMessage($phoneNumber, $textMessage); // Phone number that you received using the session id in the previous method.\n\nif ($result-\u003eisSuccess()) {\n    echo \"Phone number : \" . $result-\u003egetPhoneNumber() . \", Message : \" . $result-\u003egetMessage() . \", Status : \" . $result-\u003egetStatus() . PHP_EOL;\n} else {\n    echo \"Error message : \" . $result-\u003egetErrorMessage() . \", error code : \" . $result-\u003egetErrorCode() . PHP_EOL;\n}\n```\n\n#### Web SDK\nIf you want to use VerifyKit Web SDK, get an access token using unique id. For other details, [click here](https://github.com/verifykit/verifykit-sdk-php/blob/master/WebSDK.md).\n\n```php\n$vfk = new \\VerifyKit\\VerifyKit($serverKey, $clientIp);\n\n/** @var \\VerifyKit\\Entity\\AccessToken $result */\n$result = $vfk-\u003egetWebAccessToken();\n\nif ($result-\u003eisSuccess()) {\n    echo \"Access Token : \" . $result-\u003egetAccessToken() .\n        \", Timeout : \" . $result-\u003egetTimeout()-\u003eformat('Y-m-d H:i:s') . PHP_EOL;\n} else {\n    echo \"Error message : \" . $result-\u003egetErrorMessage() . \", error code : \" . $result-\u003egetErrorCode() . PHP_EOL;\n}\n```\n\n\n---\n\n## Author\n\nVerifyKit is owned and maintained by [VerifyKit DevTeam](mailto:sdk@verifykit.com).\n\n\n## License\n\nThe MIT License\n\nCopyright (c) 2019-2020 VerifyKit. [https://verifykit.com](https://verifykit.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverifykit%2Fverifykit-sdk-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverifykit%2Fverifykit-sdk-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverifykit%2Fverifykit-sdk-php/lists"}