Skip to content

Class: WebClient<ModelTypes>

web.WebClient

import { WebClient } from '@self.id/web'

Type parameters

Name Type
ModelTypes extends CoreModelTypes``CoreModelTypes

Hierarchy

  • Core<ModelTypes>

WebClient

Constructors

constructor

new WebClient<ModelTypes>(params)

Type parameters

Name Type
ModelTypes extends ModelTypes``ModelTypes

Parameters

Name Type
params WebClientParams<ModelTypes>

Overrides

Core<ModelTypes\>.constructor

Accessors

ceramic

get ceramic(): CeramicClient

Returns

CeramicClient


dataModel

get dataModel(): DataModel<ModelTypes, ModelTypesToAliases<ModelTypes>>

Returns

DataModel<ModelTypes, ModelTypesToAliases<ModelTypes>>


dataStore

get dataStore(): DIDDataStore<ModelTypes, keyof ModelTypes["definitions"]>

Returns

DIDDataStore<ModelTypes, keyof ModelTypes["definitions"]>


resolver

get resolver(): Resolver

Returns

Resolver


threeId

get threeId(): ThreeIdConnect

Returns

ThreeIdConnect

Methods

authenticate

authenticate(authProvider, attachToCeramic?): Promise<DID>

Parameters

Name Type Default value
authProvider EthereumAuthProvider undefined
attachToCeramic boolean false

Returns

Promise<DID>


connect

connect(authProvider): Promise<DID>

Parameters

Name Type
authProvider EthereumAuthProvider

Returns

Promise<DID>


get

get<Key, ContentType>(key, id): Promise<null | ContentType>

Type parameters

Name Type
Key extends string | number | symbol
ContentType DefinitionContentType<ModelTypes, Key>

Parameters

Name Type
key Key
id string

Returns

Promise<null | ContentType>

Inherited from

Core.get


getAccountDID

getAccountDID(account): Promise<string>

Parameters

Name Type
account string

Returns

Promise<string>

Inherited from

Core.getAccountDID


toDID

toDID(accountOrDID): Promise<string>

Parameters

Name Type
accountOrDID string

Returns

Promise<string>

Inherited from

Core.toDID