Skip to main content

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

aliases
AliasesClient
Client for managing user aliases (phone numbers, emails, etc.)See AliasesClient for details.

origins

origins
OriginsClient
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

urn
string
required
Unique resource name (URN) identifying the identity
origin
string
required
Origin namespace where the identity was registered
type
string
required
Type of identity (e.g., “individual”, “business”)
status
string
required
Current status of the identity
metadata
Record<string, unknown>
required
Additional metadata associated with the identity
profile
object
required
User profile information

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": {}
}

Build docs developers (and LLMs) love