Skip to content

UserCustomParameters

Interface thats used when handling publisher specific userdata.

Usage

access
await nautilus.access({
    assetDid: 'did:op:1234...',
    userdata:{ 
        text: 'value', 
        number: 123, 
        option: 'selected', 
        boolean: true
    } 
})

Properties

The interface is defined as follows:

interface UserCustomParameters {
    [key: string]: any
}

This means any data that is needed for the requested asset to work is supported. The keys will be defined by the publisher of the respective asset and can be found in the metadata.

If you want to learn more about how you can specify these custom parameters for your assets, you can find more information on the ConsumerParameterBuilder documentation.

However, there are a few most common scenarios (e.g. supported by marketplace and portal frontends).

Text Parameter

  • Type: string
compute
const userdata = {
    textParameter: 'value'
} satisfies UserCustomParameters

Number Parameter

  • Type: number
compute
const userdata = {
    numberParameter: 1234
} satisfies UserCustomParameters

Boolean Parameter

  • Type: boolean
compute
const userdata = {
    booleanParameter: false
} satisfies UserCustomParameters

Select Parameter

  • Type: string
compute
const userdata = {
    selectParameter: 'option'
} satisfies UserCustomParameters

In the select case, you have to pass over one of the options defined in the metadata of the requested asset.