diff --git a/docs/ecolyo/project_architecture/remote_doctypes.md b/docs/ecolyo/project_architecture/remote_doctypes.md index afb30112e81a2b78c277f0f14929665f8e63d38d..852782caf276c1be1c71e47729d597738b72cf8c 100644 --- a/docs/ecolyo/project_architecture/remote_doctypes.md +++ b/docs/ecolyo/project_architecture/remote_doctypes.md @@ -129,3 +129,16 @@ const result = await client ``` If you wanna know more about remote doctypes and how to store and use secret tokens, please refer to the official cozy documentation. + +## Add secrets to a remote + +As above, you can pass a _{{secret_token}}_ to your remote doctype. In local, you can directly pass it as a request param in _io.cozy.doctypes/org.ecolyo.usage_. +Otherwise, you will have to add it in the shell script _easy-cozy/db-init.sh_ on the server. You can add the following line to the file in order to add the secret in the database : + +``` +docker-compose exec db curl -X PUT -d "{\"_id\":\"org.ecolyo.dju\",\"token\":\"${API_DATAGRANDLYON_TOKEN}\"}" http://127.0.0.1:5984/secrets%2Fio-cozy-remote-secrets/org.ecolyo.dju +``` + +Make sure you have the right remote doctype name as \_id. + +Then, in the .env file, just add your token variable.