Skip to content

Reading records

Use the idx.get() method to query a record at runtime.

Using default aliases

Pass an alias from default definitions, and the DID or Blockchain Account ID that you wish to query.

For example if you want to query IDX data from the ethereum account 0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb on mainnet you can simply use the string [email protected]:1.

await idx.get('basicProfile', '<DID-or-caip10-id>')

API reference

Using your aliases

Pass as alias from your aliases object, and the DID or Blockchain Account ID that you wish to query.

await idx.get('myAlias', '<DID-or-caip10-id>')

API reference

Authenticated users

If a user is currently authenticated to your application, you only need to pass an alias. When no DID is provided, IDX will default to the DID of the currently authenticated user.

await idx.get('myAlias')

API reference

Example

await idx.get('basicProfile')
{
  name: 'Alan Turing',
  description: 'I make computers beep good.',
  image: '',
  emoji: '💻'
}