access
Access a specific asset by its decentralized identifier.
Usage
const accessUrl = await nautilus.access({
assetDid: 'did:op:1234abcd...'
})
// fetch the actual data
const data = await fetch(accessUrl)
Returns
string
A one-time accessible url to download the raw data of the requested asset.
Parameters
config
- Type:
AccessConfig
The configuration object for the access request.
Properties
assetDid
- Type:
string
The decentralized identifier of the asset to access.
const accessUrl = await nautilus.access({
assetDid: 'did:op:1234abcd...'
})
serviceId (optional)
- Type:
string
Optionally specify a service to access. Defaults to the first service of the asset's metadata.
const accessUrl = await nautilus.access({
assetDid: 'did:op:1234abcd...',
serviceId: 'specific-service-id'
})
fileIndex (optional)
- Type:
number
Optionally specify a file of the service to access. Defaults to the first file of the service (0
).
const accessUrl = await nautilus.access({
assetDid: 'did:op:1234abcd...',
fileIndex: 0
})
userdata (optional)
- Type:
UserCustomParameters
If the asset requires or allows for custom user parameters, these can be configured here.
Learn more about how to use custom userdata with assets in our Consumer Parameters Guide.
const accessUrl = await nautilus.access({
assetDid: 'did:op:1234abcd...',
userdata: {
parameter: 'value',
number: 123,
}
})