Overview
The OriginsClient manages identity origins and handles user registration. Origins represent entry points for identities - organizations, blockchains, or authentication providers that can hold a set of identities.
import { SDK } from '@bloque/sdk' ;
const bloque = new SDK ({
origin: 'your-origin' ,
auth: {
type: 'apiKey' ,
apiKey: 'your-api-key'
},
mode: 'production'
});
const session = await bloque . connect ( '[email protected] ' );
const origins = session . identity . origins ;
Properties
whatsapp
whatsapp
OriginClient<OTPAssertionWhatsApp>
Pre-configured client for WhatsApp-based identity verification const assertion = await bloque . identity . origins . whatsapp . assert ( '+1234567890' );
email
email
OriginClient<OTPAssertionEmail>
Pre-configured client for email-based identity verification
Methods
list()
Retrieve all available origins with their current status. Origins are the entry points for user identities and represent organizations, startups, chains, or any entity that can hold a set of identities.
const origins = await bloque . identity . origins . list ();
// Filter active origins
const activeOrigins = origins . filter ( o => o . status === 'active' );
// Find specific provider origins
const evmOrigins = origins . filter ( o => o . provider === 'evm' );
Returns
Array of origin objects:
Unique namespace identifier for the origin Examples: "ethereum-mainnet", "bloque-whatsapp", "bloque-api"
Provider type for the origin Possible values:
"evm" - Ethereum and EVM-compatible chains
"auth0" - Auth0 authentication
"whatsapp" - WhatsApp verification
"email" - Email verification
"api-key" - API key authentication
status
'active' | 'inactive' | 'disabled'
required
Current operational status of the origin
metadata
Record<string, unknown>
required
Additional metadata for the origin
ISO 8601 timestamp when the origin was created
ISO 8601 timestamp when the origin was last updated
custom()
Create a client for a custom origin namespace.
const customOrigin = bloque . identity . origins . custom ( 'my-custom-origin' );
const assertion = await customOrigin . assert ( 'user-alias' );
Parameters
The namespace of the custom origin to use
Returns
Returns an OriginClient<OTPAssertion> instance for the specified origin.
register()
Register a new user or business identity to a specific origin. Creates a new identity by verifying the assertion result (challenge response) and storing the profile information.
Supports both:
Individual users (KYC) : Personal identity verification
Business entities (KYB) : Business identity verification
Different origins support different challenge types:
SIGNING_CHALLENGE - Blockchain signature verification (Ethereum, Solana)
API_KEY - Traditional API key authentication
OAUTH_REDIRECT - OAuth-based authentication flows
WEBAUTHN - WebAuthn/passkey authentication
OTP - One-time password verification
PASSWORD - Password-based authentication
// Register individual user with blockchain signature (KYC)
const individual = await bloque . identity . origins . register (
'0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6' ,
'ethereum-mainnet' ,
{
assertionResult: {
alias: '0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6' ,
challengeType: 'SIGNING_CHALLENGE' ,
value: {
signature: '0x1234567890abcdef...' ,
alias: '0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6'
},
originalChallengeParams: {
challenge: 'bloque-challenge-1234567890' ,
timestamp: 1640995200
}
},
type: 'individual' ,
profile: {
firstName: 'John' ,
lastName: 'Doe' ,
email: '[email protected] ' ,
phone: '+1234567890' ,
birthdate: '1990-01-15' ,
city: 'New York' ,
state: 'NY' ,
postalCode: '10001' ,
countryOfBirthCode: 'USA' ,
countryOfResidenceCode: 'USA'
}
}
);
// Access token for authenticated session
console . log ( individual . accessToken );
Parameters
The unique alias for the identity (e.g., blockchain address, email, phone)
The origin namespace to register the identity to Examples: "ethereum-mainnet", "bloque-api", "bloque-whatsapp"
Registration parameters including assertion result and profile Show Individual Registration (KYC)
Specifies individual user registration
Result from the authentication challenge Type of challenge: "SIGNING_CHALLENGE", "API_KEY", "OAUTH_REDIRECT", "WEBAUTHN", "OTP", "PASSWORD"
Challenge-specific value (signature, API key, etc.) For SIGNING_CHALLENGE:
signature: The cryptographic signature
alias: The address that signed
For API_KEY:
apiKey: The API key
alias: The identifier
Original challenge parameters
challenge: Challenge string
timestamp: Unix timestamp
User profile information Date of birth (YYYY-MM-DD format)
ISO country code for birth country
ISO country code for residence country
Type of ID document (SSN, passport, etc.)
Show Business Registration (KYB)
Specifies business entity registration
Same as individual registration
Business profile information Official registered legal name of the business
Business trading name or DBA (Doing Business As)
Tax identification number (EIN, VAT, RFC, etc.)
Business legal structure (LLC, Corporation, Partnership, etc.)
Date of incorporation (YYYY-MM-DD format)
Country of incorporation (full name)
Secondary address (suite, floor, etc.)
ISO country code (2 or 3 letters)
Full name of beneficial owner
Type of owner ID document
Owner’s secondary address
Returns
JWT access token for the registered identity. Use this token for authenticated API requests.
Example: Business Registration
const business = await bloque . identity . origins . register (
'business-123' ,
'bloque-api' ,
{
assertionResult: {
alias: 'business-123' ,
challengeType: 'API_KEY' ,
value: {
apiKey: 'sk_live_abc123def456' ,
alias: 'business-123'
}
},
type: 'business' ,
profile: {
legalName: 'Acme Corporation' ,
name: 'Acme Corp' ,
taxId: '12-3456789' ,
type: 'LLC' ,
incorporationDate: '2020-01-15' ,
addressLine1: '123 Business St' ,
city: 'New York' ,
state: 'NY' ,
postalCode: '10001' ,
country: 'United States' ,
email: '[email protected] ' ,
phone: '+1-555-0123' ,
ownerName: 'Jane Smith' ,
ownerIdType: 'SSN' ,
ownerIdNumber: '123-45-6789'
}
}
);
console . log ( business . accessToken ); // JWT token