createPieceUrlPDP
createPieceUrlPDP(
options):string
Defined in: packages/synapse-core/src/utils/piece-url.ts:71
Create a piece URL for the PDP API
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | OptionsType | createPieceUrlPDP.OptionsType |
Returns
Section titled “Returns”string
The PDP URL
Example
Section titled “Example”const cid = 'bafkzcibcd4bdomn3tgwgrh3g532zopskstnbrd2n3sxfqbze7rxt7vqn7veigmy'const pieceUrl = createPieceUrlPDP({ cid, serviceURL: 'https://pdp.example.com' })console.log(pieceUrl) // https://pdp.example.com/piece/bafkzcibcd4bdomn3tgwgrh3g532zopskstnbrd2n3sxfqbze7rxt7vqn7veigmy