@textile/hub > Buckets > links
Buckets.links() method
Returns a list of bucket links.
Signature:
links(key: string, path?: string): Promise<Links>;
Parameters
Parameter | Type | Description |
---|---|---|
key | string | Unique (IPNS compatible) identifier key for a bucket. |
path | string | path within the bucket for links (default '/'). |
Returns:
Promise<Links>
Example
Generate the HTTP, IPNS, and IPFS links for a Bucket
import { Buckets } from '@textile/hub'
const getIpnsLink = async (buckets: Buckets, bucketKey: string) => {
const links = await buckets.links(bucketKey)
return links.ipns
}
const getWwwLink = async (buckets: Buckets, bucketKey: string) => {
const links = await buckets.links(bucketKey)
return links.www
}