sts-digital-identity
v1.0.0
Published
SDK for FIDO2 and Digital Identity verification
Readme
STS Digital Identity SDK
The official SDK for integrating Safe Trade Services Digital Identity into your web applications. Enable Passkey-protected, reusable identity verification with custom trust logic in minutes.
Features
- Passkey Native: Built-in support for FIDO2/WebAuthn hardware-backed security.
- Provider Agnostic: Define trust rules across multiple KYC/KYB vendors via a single API.
- Zero-Friction: Users verify once and bring their identity to any platform in the STS ecosystem.
- Cost-Efficient: Shift the complexity and cost of verification to the user.
Installation
Install the SDK via npm:
npm install sts-digital-identity
Quick Start
1. Initialize the SDK
Initialize the library with your public API key (available in your STS Dashboard).
import { DigitalIdentity } from 'sts-digital-identity';
DigitalIdentity.init("pk_live_your_key_here");
2. Define Trust Requirements
Set up your verification logic using simple and / or conditions.
const requirements = { "and": [ { "or": ["persona:identity", "sumsub:document"] }, "plaid:bank_account" ] };
3. Trigger Verification
Execute the verification process. This automatically handles the browser native Passkey prompt and cryptographic handshake.
async function handleVerification() { try { const isApproved = await DigitalIdentity.verify( "user_token_from_form", requirements );
if (isApproved) {
console.log("User verified successfully!");
// Proceed with high-value action
}} catch (error) { console.error("Verification failed:", error); } }
API Reference
DigitalIdentity.init(apiKey: string)
Sets the global configuration for your project. Should be called once at the entry point of your app.
DigitalIdentity.verify(userToken: string, requirements: TrustRequirement)
- userToken: The token collected from the user (Ask the user to user their Public Token).
- requirements: A JSON object defining which providers are required for a Passed status.
- Returns: Promise
Security
This SDK implements hardware-backed attestation to prevent link-sharing fraud and impersonation. All sensitive biometric and document data is handled by Safe Trade Services and never touches your local servers.
Support
- Documentation: api.safetradeservices.com
- Email: [email protected]
- GitHub Issues: Report a bug at the official repository.
