Search by

veilio / sdk

Slyrack

Official Veilio SDK for PHP — data tokenization and cyber-resilience API client

v1.0.1 2026-12-02 15:34 UTC

This package is auto-updated.

Last update: 2026-12-02 15:38:07 UTC


README

Official PHP SDK for Veilio — data tokenization and cyber-resilience API client.

Requirements

  • PHP 8.1+
  • Extensions: curl, json

Installation

composer require veilio/sdk

From VCS (before / without Packagist):

composer require veilio/sdk:dev-main --repository='{"type":"vcs","url":"https://github.com/VeilioAPI/veilio-sdk-php"}'

Quick start

<?php

require __DIR__ . '/vendor/autoload.php';

use Veilio\Sdk\VeilioClient;
use Veilio\Sdk\Exception\VeilioException;

$veilio = new VeilioClient(
    apiKey: getenv('VEILIO_API_KEY') ?: '',
    baseUrl: getenv('VEILIO_BASE_URL') ?: 'https://app.veilio.fr/api',
);

$result = $veilio->tokenize(
    data: 'john@example.com',
    type: 'email',
);

// Store $result['token'] in your DB — never the clear email.
$original = $veilio->detokenize(
    token: $result['token'],
    reason: 'Send welcome email',
);

$veilio->shredToken(
    token: $result['token'],
    reason: 'GDPR - user deletion request',
);

On-premise:

$veilio = new VeilioClient(
    apiKey: getenv('VEILIO_API_KEY') ?: '',
    baseUrl: 'https://your-domain.com/api',
);

API surface

Method Endpoint
tokenize POST /tokenize
tokenizeBulk POST /tokenize/bulk
detokenize POST /detokenize
detokenizeBulk POST /detokenize/bulk
tokenizeFormat POST /tokenize/format
detokenizeFormat POST /detokenize/format
shredToken POST /tokens/shred
shredBulk POST /tokens/shred-bulk
lookup POST /lookup
previewDocument POST /documents/preview
tokenizeDocument POST /tokenize/document
detokenizeDocument POST /detokenize/document
listDocuments GET /documents
storeDocument POST /documents
getDocument GET /documents/:id
deleteDocument DELETE /documents/:id

FPT example:

$phone = $veilio->tokenize(
    data: '0612345678',
    type: 'phone',
    mode: 'fpt',
    entityId: 'BP10042',
);
// $phone['token'] === '0600000000'

$clear = $veilio->detokenize(
    token: $phone['token'],
    entityId: 'BP10042',
    reason: 'Partner screen',
);

Errors

use Veilio\Sdk\Exception\AuthenticationException;
use Veilio\Sdk\Exception\PlanLimitException;
use Veilio\Sdk\Exception\RateLimitException;
use Veilio\Sdk\Exception\TokenShreddedException;
use Veilio\Sdk\Exception\VeilioException;

try {
    $veilio->detokenize(token: 'tok_…', reason: 'Support');
} catch (AuthenticationException $e) {
    // 401
} catch (RateLimitException $e) {
    // 429 — $e->retryAfter
} catch (PlanLimitException $e) {
    // 403 PLAN_LIMIT
} catch (TokenShreddedException $e) {
    // 410
} catch (VeilioException $e) {
    // $e->getErrorCode(), $e->statusCode
}

Docs

License

MIT