How to use the client on Node environment (
ReferenceError: fetch is not defined) ?¶
import fetch from 'node-fetch' import CozyClient from 'cozy-client' global.fetch = fetch
Then you will be able to use all the client methods and fetch data correctly.
When using cozy-client on Node environment, you don’t have access to all React
specific APIs. If, for any reason, you want to access these APIs, you can still
import them from
How to activate logging ?¶
Cozy-client libs use
minilog for internal logging.
If you need to see those logs, you need to tell minilog to show them, they are filtered by
default. Each lib has a different namespace that can be enabled/disabled.
For example if you want to allow
cozy-pouch-link logs at
debug level, you can do:
If you want to see everything :
More info on minilog docs.