Download the PHP package smileid/usesmileid without Composer

On this page you can find all versions of the php package smileid/usesmileid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package usesmileid

smileid/usesmileid

Packagist version CI status License

Official Smile ID server-side SDK for PHP — V3 APIs.

This project is under active development. It's not yet published to Packagist, and the API surface may change without notice. Don't use it in production yet.

Requirements

Install

Create a client

Construct one client with your partner ID and API key. Before each request the SDK fetches a short-lived access token. A verification job's token is bound to that job's product and, when the job names one, its user; other calls get a token with neither. You never handle tokens yourself.

Constructor options:

Option Required Default Notes
partnerId yes — numeric string; partner ids are displayed zero-padded (for example 002) but must be passed without leading zeros (2)
apiKey yes — your partner API key
environment no sandbox sandbox or production
defaultCallbackUrl no unset used when a call omits callbackUrl; must be https
baseUrl no derived explicit override; wins over environment; must be an absolute https URL with no query or fragment
timeout no 30.0 per-request total timeout in seconds
maxRetries no 2 retries for idempotent operations only
httpClient no Guzzle any GuzzleHttp\ClientInterface, injectable for testing

Environments

environment names two hosts:

Any other host needs baseUrl, which wins over environment:

Outside production, Smile ID matches test identities on given names + last name + email. An identity it does not recognise resolves to block.

All URLs you give the SDK must be https. The base URL must be absolute with no query or fragment, and callback URLs (defaultCallbackUrl and per-request callbackUrl) must be absolute https URLs. Anything else raises ValidationError before a request is made.

Binary inputs

Methods that upload images accept a file path, an open stream resource, or a string of raw bytes. When a plain string is ambiguous, use the explicit factories:

Consent and user details

All verification submissions need a consent block and the user's details. Build consent with Consent::granted(...), which always records consent as given. userDetails is an associative array with wire field names; at least one of email or phone_number is required.

The examples below assume $smile, $consent and $userDetails from above.

Methods

Enhanced KYC

Verify an ID number against the issuing authority.

Document verification

Verify a selfie and liveness images against a photo ID document. livenessImages takes 6 to 8 images.

Enhanced document verification

The same as document verification, but idType is required and the document is also checked against the issuing authority.

Residency document verification

Verify a selfie against a passport and read the visa endorsed in it. The passport and visa are separate images, and idType is optional and defaults to PASSPORT, the only value the API accepts. Any other value throws a ValidationError before the request is sent. The result arrives by callback.

Biometric KYC

Verify a selfie against the photo on file with an ID authority.

To verify against a user's enrolled selfie instead of a fresh capture, pass useEnrolledImage: true and the enrolled userId; the selfie and liveness images may then be omitted.

Biometric enrollment

Register a user's selfie for later authentication.

Biometric authentication

Authenticate a returning user against a fresh selfie and liveness capture. userId must match an enrollee.

Selfie compare

Compare a selfie with another image: a document photo, an ID photo, or a portrait.

Check a verification

A job that is not found returns a JobStatus with status of not_found rather than throwing, so you can poll a job that has not landed yet.

Wait for a verification to complete

Polls while the status is processing (and, by default, while it is not_found), and returns as soon as the job reports a decision. Throws SmileIdentity\Errors\TimeoutError if the job does not complete in time.

Replay a callback

Ask Smile ID to resend the callback for a completed verification. Replaying a job that is still processing throws ConflictError.

Report user fraud

reason is required when reporting fraud; notes is required when clearing a report or when the reason is OTHER.

Bank codes

No authentication needed.

Supported ID types

No authentication needed.

Supported documents

No authentication needed.

ID authority status

Check whether an ID authority is currently reachable.

Error handling

Every error the SDK throws extends SmileIdentity\Errors\SmileIDError, which extends \Exception. Catch the base class to handle everything, or a subclass to handle one case:

Class Raised on
InvalidRequestError HTTP 400 or 415
ValidationError client-side validation, before anything is sent
AuthenticationError HTTP 401
PaymentRequiredError HTTP 402, insufficient wallet balance
PermissionError HTTP 403
NotFoundError HTTP 404 (except verifications->retrieve)
ConflictError HTTP 409, replay of a job still processing
PayloadTooLargeError HTTP 413
RateLimitError HTTP 429
UnexpectedResponseError a 2xx response whose body is not a JSON object
APIError HTTP 5xx
ConnectionError network failure, no HTTP response
TimeoutError waitUntilComplete deadline passed

Retries

The SDK retries idempotent operations only: status and services reads, and the token fetch made before each request. It retries on connection errors, 408, 429 and 5xx, honours the Retry-After header, and never retries a 409. Verification submissions are never retried automatically — a connection failure surfaces as ConnectionError and you decide whether to resubmit.

Telemetry

Every request carries three headers identifying the SDK: SmileID-Source-SDK: php, SmileID-Source-SDK-Version, and a User-Agent of the form smileid-sdk-php/<version> (php/<php-version>). They are observability metadata, never authentication, and carry no personal data.

Security

See SECURITY.md for how to report a vulnerability.

License

MIT. See LICENSE.


All versions of usesmileid with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package smileid/usesmileid contains the following files

Loading the files please wait ...