@textile/hub > Buckets > withThread
Buckets.withThread() method
Scope future API calls to a specific thread. For both Buckets and Threads, many API calls require knowledge about which thread you are making requests against. Use withThread
to declare your target thread before making those API calls.
Signature:
withThread(threadID?: string): void;
Parameters
Parameter | Type | Description |
---|---|---|
threadID | string |
Returns:
void
Example
import { Buckets, ThreadID } from '@textile/hub'
async function example (threadID: ThreadID) {
const id = threadID.toString()
const buckets = await Buckets.withThread(id)
}