Ipfs.pin.remote.service.add undefined... help please!

Hello!
Any help on this would be really appreciated - thanks :smiley:

Using js-ipfs, in node.js.
installed with npm install --save ipfs

I’m continually getting the following error when trying to add a remote pinning service.

(node:9004) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'service' of undefined

using the line:

const node = await IPFS.create();
...
await node.pin.remote.service.add(PINNING_SERVICE_NAME, {
	endpoint: PINNING_SERVICE_ENDPOINT,
	key: PINNING_SERVICE_API_KEY
})

Note, the script successfully create()s a new ipfs node, and can node.add() and node.pin.add() without problem. Any ideas why the remote service part is undefined? Full error below.

Thank you very much for your help!

 (node:9004) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'service' of undefined
at main (c:\Users\me\myproject\pinRemote.js:38:24)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:9004) TypeError: Cannot read property 'service' of undefined
at main (c:\Users\me\myproject\pinRemote.js:38:24)
(node:9004) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
at emitDeprecationWarning (internal/process/promises.js:180:11)
at processPromiseRejections (internal/process/promises.js:249:13)
at processTicksAndRejections (internal/process/task_queues.js:94:32)

Are you sure this feature is ready in ‘js-ipfs’ already ?

see these:

1 Like

Thanks for the links - you’re quite right.
Confirmed here too:

I was confused with pin.remote.service appearing in the js-ipfs docs: js-ipfs/PIN.md at master · ipfs/js-ipfs · GitHub

But not in the js-ipfs packages: js-ipfs/packages/ipfs-core/src/components/pin at master · ipfs/js-ipfs · GitHub

Honestly I’m still new to the way all of this is structured - thanks for your help with understanding it.

I have another question if you wouldn’t mind:
What is the purpose of the /docs/ folder, and why would it differ from what is provided in /packages/ ?

Thanks