Download the PHP package trustport/sdk without Composer
On this page you can find all versions of the php package trustport/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download trustport/sdk
More information about trustport/sdk
Files in trustport/sdk
Informations about the package sdk
trustport/sdk
Server-side SDK for Trustport — phishing-resistant passkey verification for your existing login flow.
This SDK targets the embedded widget (Verify) mode. If you want the OAuth-based "Sign in with Trustport" flow instead, see the Trustport developer docs.
Install
Requires PHP ≥ 7.4 with ext-curl and ext-json (both bundled with every distro of PHP).
No composer / shared hosting? Use the single-file drop-in instead — same API, no dependencies.
Quickstart
Full example (vanilla PHP)
API reference
new Trustport\Client(array $options)
| Option | Type | Default | Notes |
|---|---|---|---|
apiKey |
string | — | Required. From Trustport admin → Integrations. |
baseUrl |
string | https://trustport.vospen.com |
For self-hosted instances. |
timeoutSeconds |
int | 10 |
Per-request timeout. |
$tp->startSession(['subject' => $username]): VerifySession
Returns:
Throws TrustportException with:
errorCode = "subject_not_enrolled"(HTTP 404)errorCode = "no_active_device"(HTTP 409)errorCode = "invalid_api_key"(HTTP 401)
$tp->verifySession(['sid' => ..., 'claimToken' => ...]): VerifyResult
Single-use server-to-server confirmation.
Returns VerifyResult:
Throws TrustportException for transport/auth errors.
Trustport\TrustportException
Security
- Never expose
claimTokento the browser. Keep it in$_SESSIONor another server-side store. - Never expose
apiKeyto the browser. Load from environment. - Sessions auto-expire after 2 minutes.
verifySessionis single-use — replay attempts return['ok' => false, 'status' => 'claimed'].
Links
- Trustport developer docs: https://trustport.vospen.com/docs
- Source: https://github.com/Emin4ik/trustport
- Issues: https://github.com/Emin4ik/trustport/issues
License
MIT
All versions of sdk with dependencies
ext-curl Version *
ext-json Version *