@textile/hub > Client > getDBInfo
Client.getDBInfo() method
Returns a DBInfo objection containing metadata required to invite other peers to join a given thread.
Signature:
getDBInfo(threadID: ThreadID): Promise<DBInfo>;
Parameters
Parameter | Type | Description |
---|---|---|
threadID | ThreadID | the ID of the database |
Returns:
Promise<DBInfo>
An object with an encoded thread key, and a list of multiaddrs.
Example
Get DB info and use DB info to join an existing remote thread (e.g. invited)
import {Client, DBInfo, ThreadID} from '@textile/hub'
async function getInfo (client: Client, threadID: ThreadID): Promise<DBInfo> {
return await client.getDBInfo(threadID)
}
async function joinFromInfo (client: Client, info: DBInfo) {
return await client.joinFromInfo(info)
}