Skip to content

Class: SelfID<ModelTypes, Alias>

web.SelfID

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

Type parameters

Name Type
ModelTypes extends CoreModelTypes``CoreModelTypes
Alias extends keyof ModelTypes["definitions"]keyof ModelTypes["definitions"]

Constructors

constructor

new SelfID<ModelTypes, Alias>(params)

Type parameters

Name Type
ModelTypes extends ModelTypes``ModelTypes
Alias extends string | number | symbolkeyof ModelTypes["definitions"]

Parameters

Name Type
params SelfIDParams

Accessors

client

get client(): WebClient<ModelTypes>

Returns

WebClient<ModelTypes>


id

get id(): string

Returns

string

Methods

get

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

Type parameters

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

Parameters

Name Type
key Key

Returns

Promise<null | ContentType>


set

set<Key, ContentType>(key, content): Promise<StreamID>

Type parameters

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

Parameters

Name Type
key Key
content ContentType

Returns

Promise<StreamID>


authenticate

Static authenticate<ModelTypes>(params): Promise<SelfID<ModelTypes, "alsoKnownAs" | "basicProfile" | "cryptoAccounts">>

Type parameters

Name Type
ModelTypes extends ModelTypes``ModelTypes

Parameters

Name Type
params AuthenticateParams<ModelTypes>

Returns

Promise<SelfID<ModelTypes, "alsoKnownAs" | "basicProfile" | "cryptoAccounts">>