Overview
The IdentityClient provides access to identity management functionality including user profiles, aliases, and origin management.
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 identity = session.identity;
Properties
aliases
Client for managing user aliases (phone numbers, emails, etc.)See AliasesClient for details.
origins
Client for managing identity origins and registrationSee OriginsClient for details.
Methods
me()
Retrieve the authenticated user’s identity information including profile data, status, and metadata.
const identity = await bloque.identity.me();
console.log(identity.urn); // "did:bloque:origin:..."
console.log(identity.profile.email); // User's email
Returns
Unique resource name (URN) identifying the identity
Origin namespace where the identity was registered
Type of identity (e.g., “individual”, “business”)
Current status of the identity
metadata
Record<string, unknown>
required
Additional metadata associated with the identity
User profile information
Date of birth in ISO 8601 format (YYYY-MM-DD)
Secondary address line (optional)
ISO country code for country of birth
country_of_residence_code
ISO country code for country of residence
Type of personal identification document
Personal identification number
Example Response
{
"urn": "did:bloque:origin:ethereum-mainnet:0x742d35...",
"origin": "ethereum-mainnet",
"type": "individual",
"status": "active",
"profile": {
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"phone": "+1234567890",
"birthdate": "1990-01-15",
"gender": "male",
"address_line1": "123 Main St",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"neighborhood": "Manhattan",
"country_of_birth_code": "USA",
"country_of_residence_code": "USA",
"personal_id_type": "SSN",
"personal_id_number": "***-**-6789"
},
"metadata": {}
}