{"action":"created","comment":{"url":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/comments/169327922","pull_request_review_id":97834963,"id":169327922,"diff_hunk":"@@ -2,35 +2,52 @@\n \n ## Introduction\n \n-**New! Want an interactive tutorial on how to create a connector? Try [this one](https://tech.io/playgrounds/1482/cozy-connector-tutorial):**\n+A connector is a simple script which imports data from other web services and put it in your cozy.\n+Each connector in an independant application, managed by the [Cozy Collect](https://github.com/cozy/cozy-collect)\n+application.\n \n-A connector is a small script that allows to import data from an external website. Each connector is an independent application, managed by the Cozy Collect application.\n+To protect your data, each connector runs inside a container in order to sandbox all their\n+interactions with your data.\n \n-To protect your data, each connector runs inside a sandbox where all their interactions with your data are under control.\n+## How does it work ?\n \n-From a technical point of view, connectors are Node.js applications executed inside a container. They communicate with the server using its API, like client side apps, and get an auth token every time they start. They need to register with a manifest, and ask permissions to the user.\n+A connector is a NodeJS script. The target node version used to run your connector is the\n+[current LTS version](https://nodejs.org) (8 at the moment).\n \n-To ease the development of a connector, an npm package, named [cozy-connector-libs](https://github.com/cozy/cozy-konnector-libs) provides a lot of\n-shared libraries. But you may need some other npm packages to help you running your connector: \n+Like client side apps, connectors communicate with the [Cozy Stack](https://cozy.github.io/cozy-stack/)\n+using its API, and get an auth token every time they start. They need to register with a manifest,\n+and ask permissions to the user.\n \n- - [moment](http://momentjs.com/docs/) to manage dates \n+To ease the development of a connector, a npm package, named [cozy-konnector-libs](https://github.com/cozy/cozy-konnector-libs)\n+provides some shared libraries which are adapted to be used for a connector :\n+ - [cheerio](https://cheerio.js.org) to easily request html pages like jQuery\n+ - [request-promise](https://github.com/request/request-promise): [request](https://github.com/request/request) wrapped in promises\n+ - [request-debug](https://github.com/request/request-debug) which displays all the requests and\n+   responses in the standard output. Check \"debug\" option in [requestFactory](https://github.com/cozy/cozy-konnector-libs/blob/master/docs/api.md#requestFactory)\n \n-When the application is started, it also gets some data through environment variables:\n+But you may need some other npm packages to help you running your connector and\n+which are not integrated to cozy-konnector-libs :\n+\n+ - [momentjs](http://momentjs.com/docs/) or [dade-fns](https://date-fns.org) to manage dates\n+ - [bluebird](http://bluebirdjs.com) to get enhanced promises\n+\n+When the connector is started, it also gets some data through environment variables:\n \n  - `COZY_CREDENTIALS` : the auth token used by `cozy-client-js` to communicate with the server \n  - `COZY_URL` : the API entry point \n- - `COZY_FIELD` : the settings specific to each connector, for example the path of folder where the user wants to store the remote files \n-\n-But the base connector (`require('cozy-konnector-libs').BaseKonnector`) in cozy-konnector-libs handles these for you.\n+ - `COZY_FIELDS` : the settings comming from [cozy-collect](https://github.com/cozy/cozy-collect) and filled by the user of the connector (login, password, directory path).","path":"src/dev/konnector.md","position":48,"original_position":48,"commit_id":"4af8e185891cc6edfe4163256234b965f1949db0","original_commit_id":"4af8e185891cc6edfe4163256234b965f1949db0","user":{"login":"ptbrowne","id":465582,"avatar_url":"https://avatars1.githubusercontent.com/u/465582?v=4","gravatar_id":"","url":"https://api.github.com/users/ptbrowne","html_url":"https://github.com/ptbrowne","followers_url":"https://api.github.com/users/ptbrowne/followers","following_url":"https://api.github.com/users/ptbrowne/following{/other_user}","gists_url":"https://api.github.com/users/ptbrowne/gists{/gist_id}","starred_url":"https://api.github.com/users/ptbrowne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptbrowne/subscriptions","organizations_url":"https://api.github.com/users/ptbrowne/orgs","repos_url":"https://api.github.com/users/ptbrowne/repos","events_url":"https://api.github.com/users/ptbrowne/events{/privacy}","received_events_url":"https://api.github.com/users/ptbrowne/received_events","type":"User","site_admin":false},"body":"comming/coming","created_at":"2018-02-20T14:07:48Z","updated_at":"2018-02-20T14:28:19Z","html_url":"https://github.com/cozy/cozy-docs-v3/pull/36#discussion_r169327922","pull_request_url":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/36","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/comments/169327922"},"html":{"href":"https://github.com/cozy/cozy-docs-v3/pull/36#discussion_r169327922"},"pull_request":{"href":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/36","id":170016128,"html_url":"https://github.com/cozy/cozy-docs-v3/pull/36","diff_url":"https://github.com/cozy/cozy-docs-v3/pull/36.diff","patch_url":"https://github.com/cozy/cozy-docs-v3/pull/36.patch","issue_url":"https://api.github.com/repos/cozy/cozy-docs-v3/issues/36","number":36,"state":"open","locked":false,"title":"Build a good entry point for connectors contributors","user":{"login":"doubleface","id":228695,"avatar_url":"https://avatars3.githubusercontent.com/u/228695?v=4","gravatar_id":"","url":"https://api.github.com/users/doubleface","html_url":"https://github.com/doubleface","followers_url":"https://api.github.com/users/doubleface/followers","following_url":"https://api.github.com/users/doubleface/following{/other_user}","gists_url":"https://api.github.com/users/doubleface/gists{/gist_id}","starred_url":"https://api.github.com/users/doubleface/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doubleface/subscriptions","organizations_url":"https://api.github.com/users/doubleface/orgs","repos_url":"https://api.github.com/users/doubleface/repos","events_url":"https://api.github.com/users/doubleface/events{/privacy}","received_events_url":"https://api.github.com/users/doubleface/received_events","type":"User","site_admin":false},"body":null,"created_at":"2018-02-19T17:19:57Z","updated_at":"2018-02-20T14:28:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b917d18f843c271037c877ad7dbe41c00531ae3","assignee":null,"assignees":[],"requested_reviewers":[{"login":"clochix","id":384908,"avatar_url":"https://avatars0.githubusercontent.com/u/384908?v=4","gravatar_id":"","url":"https://api.github.com/users/clochix","html_url":"https://github.com/clochix","followers_url":"https://api.github.com/users/clochix/followers","following_url":"https://api.github.com/users/clochix/following{/other_user}","gists_url":"https://api.github.com/users/clochix/gists{/gist_id}","starred_url":"https://api.github.com/users/clochix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clochix/subscriptions","organizations_url":"https://api.github.com/users/clochix/orgs","repos_url":"https://api.github.com/users/clochix/repos","events_url":"https://api.github.com/users/clochix/events{/privacy}","received_events_url":"https://api.github.com/users/clochix/received_events","type":"User","site_admin":false},{"login":"gregorylegarec","id":776764,"avatar_url":"https://avatars3.githubusercontent.com/u/776764?v=4","gravatar_id":"","url":"https://api.github.com/users/gregorylegarec","html_url":"https://github.com/gregorylegarec","followers_url":"https://api.github.com/users/gregorylegarec/followers","following_url":"https://api.github.com/users/gregorylegarec/following{/other_user}","gists_url":"https://api.github.com/users/gregorylegarec/gists{/gist_id}","starred_url":"https://api.github.com/users/gregorylegarec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregorylegarec/subscriptions","organizations_url":"https://api.github.com/users/gregorylegarec/orgs","repos_url":"https://api.github.com/users/gregorylegarec/repos","events_url":"https://api.github.com/users/gregorylegarec/events{/privacy}","received_events_url":"https://api.github.com/users/gregorylegarec/received_events","type":"User","site_admin":false},{"login":"kosssi","id":1135513,"avatar_url":"https://avatars2.githubusercontent.com/u/1135513?v=4","gravatar_id":"","url":"https://api.github.com/users/kosssi","html_url":"https://github.com/kosssi","followers_url":"https://api.github.com/users/kosssi/followers","following_url":"https://api.github.com/users/kosssi/following{/other_user}","gists_url":"https://api.github.com/users/kosssi/gists{/gist_id}","starred_url":"https://api.github.com/users/kosssi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosssi/subscriptions","organizations_url":"https://api.github.com/users/kosssi/orgs","repos_url":"https://api.github.com/users/kosssi/repos","events_url":"https://api.github.com/users/kosssi/events{/privacy}","received_events_url":"https://api.github.com/users/kosssi/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/36/commits","review_comments_url":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/36/comments","review_comment_url":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cozy/cozy-docs-v3/issues/36/comments","statuses_url":"https://api.github.com/repos/cozy/cozy-docs-v3/statuses/4af8e185891cc6edfe4163256234b965f1949db0","head":{"label":"doubleface:konnectorsv3","ref":"konnectorsv3","sha":"4af8e185891cc6edfe4163256234b965f1949db0","user":{"login":"doubleface","id":228695,"avatar_url":"https://avatars3.githubusercontent.com/u/228695?v=4","gravatar_id":"","url":"https://api.github.com/users/doubleface","html_url":"https://github.com/doubleface","followers_url":"https://api.github.com/users/doubleface/followers","following_url":"https://api.github.com/users/doubleface/following{/other_user}","gists_url":"https://api.github.com/users/doubleface/gists{/gist_id}","starred_url":"https://api.github.com/users/doubleface/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doubleface/subscriptions","organizations_url":"https://api.github.com/users/doubleface/orgs","repos_url":"https://api.github.com/users/doubleface/repos","events_url":"https://api.github.com/users/doubleface/events{/privacy}","received_events_url":"https://api.github.com/users/doubleface/received_events","type":"User","site_admin":false},"repo":{"id":94581468,"name":"gozy-docs","full_name":"doubleface/gozy-docs","owner":{"login":"doubleface","id":228695,"avatar_url":"https://avatars3.githubusercontent.com/u/228695?v=4","gravatar_id":"","url":"https://api.github.com/users/doubleface","html_url":"https://github.com/doubleface","followers_url":"https://api.github.com/users/doubleface/followers","following_url":"https://api.github.com/users/doubleface/following{/other_user}","gists_url":"https://api.github.com/users/doubleface/gists{/gist_id}","starred_url":"https://api.github.com/users/doubleface/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doubleface/subscriptions","organizations_url":"https://api.github.com/users/doubleface/orgs","repos_url":"https://api.github.com/users/doubleface/repos","events_url":"https://api.github.com/users/doubleface/events{/privacy}","received_events_url":"https://api.github.com/users/doubleface/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/doubleface/gozy-docs","description":null,"fork":true,"url":"https://api.github.com/repos/doubleface/gozy-docs","forks_url":"https://api.github.com/repos/doubleface/gozy-docs/forks","keys_url":"https://api.github.com/repos/doubleface/gozy-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doubleface/gozy-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doubleface/gozy-docs/teams","hooks_url":"https://api.github.com/repos/doubleface/gozy-docs/hooks","issue_events_url":"https://api.github.com/repos/doubleface/gozy-docs/issues/events{/number}","events_url":"https://api.github.com/repos/doubleface/gozy-docs/events","assignees_url":"https://api.github.com/repos/doubleface/gozy-docs/assignees{/user}","branches_url":"https://api.github.com/repos/doubleface/gozy-docs/branches{/branch}","tags_url":"https://api.github.com/repos/doubleface/gozy-docs/tags","blobs_url":"https://api.github.com/repos/doubleface/gozy-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doubleface/gozy-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doubleface/gozy-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/doubleface/gozy-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doubleface/gozy-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/doubleface/gozy-docs/languages","stargazers_url":"https://api.github.com/repos/doubleface/gozy-docs/stargazers","contributors_url":"https://api.github.com/repos/doubleface/gozy-docs/contributors","subscribers_url":"https://api.github.com/repos/doubleface/gozy-docs/subscribers","subscription_url":"https://api.github.com/repos/doubleface/gozy-docs/subscription","commits_url":"https://api.github.com/repos/doubleface/gozy-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/doubleface/gozy-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/doubleface/gozy-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/doubleface/gozy-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/doubleface/gozy-docs/contents/{+path}","compare_url":"https://api.github.com/repos/doubleface/gozy-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doubleface/gozy-docs/merges","archive_url":"https://api.github.com/repos/doubleface/gozy-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doubleface/gozy-docs/downloads","issues_url":"https://api.github.com/repos/doubleface/gozy-docs/issues{/number}","pulls_url":"https://api.github.com/repos/doubleface/gozy-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/doubleface/gozy-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/doubleface/gozy-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doubleface/gozy-docs/labels{/name}","releases_url":"https://api.github.com/repos/doubleface/gozy-docs/releases{/id}","deployments_url":"https://api.github.com/repos/doubleface/gozy-docs/deployments","created_at":"2017-06-16T21:10:52Z","updated_at":"2017-06-06T13:33:40Z","pushed_at":"2018-02-20T11:00:54Z","git_url":"git://github.com/doubleface/gozy-docs.git","ssh_url":"git@github.com:doubleface/gozy-docs.git","clone_url":"https://github.com/doubleface/gozy-docs.git","svn_url":"https://github.com/doubleface/gozy-docs","homepage":null,"size":2895,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cozy:master","ref":"master","sha":"98b77c6d78ff5ee0f2fc24d03e96cf92ad79962a","user":{"login":"cozy","id":7690525,"avatar_url":"https://avatars0.githubusercontent.com/u/7690525?v=4","gravatar_id":"","url":"https://api.github.com/users/cozy","html_url":"https://github.com/cozy","followers_url":"https://api.github.com/users/cozy/followers","following_url":"https://api.github.com/users/cozy/following{/other_user}","gists_url":"https://api.github.com/users/cozy/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy/subscriptions","organizations_url":"https://api.github.com/users/cozy/orgs","repos_url":"https://api.github.com/users/cozy/repos","events_url":"https://api.github.com/users/cozy/events{/privacy}","received_events_url":"https://api.github.com/users/cozy/received_events","type":"Organization","site_admin":false},"repo":{"id":93522137,"name":"cozy-docs-v3","full_name":"cozy/cozy-docs-v3","owner":{"login":"cozy","id":7690525,"avatar_url":"https://avatars0.githubusercontent.com/u/7690525?v=4","gravatar_id":"","url":"https://api.github.com/users/cozy","html_url":"https://github.com/cozy","followers_url":"https://api.github.com/users/cozy/followers","following_url":"https://api.github.com/users/cozy/following{/other_user}","gists_url":"https://api.github.com/users/cozy/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy/subscriptions","organizations_url":"https://api.github.com/users/cozy/orgs","repos_url":"https://api.github.com/users/cozy/repos","events_url":"https://api.github.com/users/cozy/events{/privacy}","received_events_url":"https://api.github.com/users/cozy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cozy/cozy-docs-v3","description":null,"fork":false,"url":"https://api.github.com/repos/cozy/cozy-docs-v3","forks_url":"https://api.github.com/repos/cozy/cozy-docs-v3/forks","keys_url":"https://api.github.com/repos/cozy/cozy-docs-v3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cozy/cozy-docs-v3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cozy/cozy-docs-v3/teams","hooks_url":"https://api.github.com/repos/cozy/cozy-docs-v3/hooks","issue_events_url":"https://api.github.com/repos/cozy/cozy-docs-v3/issues/events{/number}","events_url":"https://api.github.com/repos/cozy/cozy-docs-v3/events","assignees_url":"https://api.github.com/repos/cozy/cozy-docs-v3/assignees{/user}","branches_url":"https://api.github.com/repos/cozy/cozy-docs-v3/branches{/branch}","tags_url":"https://api.github.com/repos/cozy/cozy-docs-v3/tags","blobs_url":"https://api.github.com/repos/cozy/cozy-docs-v3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cozy/cozy-docs-v3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cozy/cozy-docs-v3/git/refs{/sha}","trees_url":"https://api.github.com/repos/cozy/cozy-docs-v3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cozy/cozy-docs-v3/statuses/{sha}","languages_url":"https://api.github.com/repos/cozy/cozy-docs-v3/languages","stargazers_url":"https://api.github.com/repos/cozy/cozy-docs-v3/stargazers","contributors_url":"https://api.github.com/repos/cozy/cozy-docs-v3/contributors","subscribers_url":"https://api.github.com/repos/cozy/cozy-docs-v3/subscribers","subscription_url":"https://api.github.com/repos/cozy/cozy-docs-v3/subscription","commits_url":"https://api.github.com/repos/cozy/cozy-docs-v3/commits{/sha}","git_commits_url":"https://api.github.com/repos/cozy/cozy-docs-v3/git/commits{/sha}","comments_url":"https://api.github.com/repos/cozy/cozy-docs-v3/comments{/number}","issue_comment_url":"https://api.github.com/repos/cozy/cozy-docs-v3/issues/comments{/number}","contents_url":"https://api.github.com/repos/cozy/cozy-docs-v3/contents/{+path}","compare_url":"https://api.github.com/repos/cozy/cozy-docs-v3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cozy/cozy-docs-v3/merges","archive_url":"https://api.github.com/repos/cozy/cozy-docs-v3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cozy/cozy-docs-v3/downloads","issues_url":"https://api.github.com/repos/cozy/cozy-docs-v3/issues{/number}","pulls_url":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls{/number}","milestones_url":"https://api.github.com/repos/cozy/cozy-docs-v3/milestones{/number}","notifications_url":"https://api.github.com/repos/cozy/cozy-docs-v3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cozy/cozy-docs-v3/labels{/name}","releases_url":"https://api.github.com/repos/cozy/cozy-docs-v3/releases{/id}","deployments_url":"https://api.github.com/repos/cozy/cozy-docs-v3/deployments","created_at":"2017-06-06T13:33:40Z","updated_at":"2018-02-03T01:17:33Z","pushed_at":"2018-02-20T11:00:55Z","git_url":"git://github.com/cozy/cozy-docs-v3.git","ssh_url":"git@github.com:cozy/cozy-docs-v3.git","clone_url":"https://github.com/cozy/cozy-docs-v3.git","svn_url":"https://github.com/cozy/cozy-docs-v3","homepage":"https://cozy.github.io/cozy-docs-v3/en/","size":2885,"stargazers_count":4,"watchers_count":4,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":22,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/36"},"html":{"href":"https://github.com/cozy/cozy-docs-v3/pull/36"},"issue":{"href":"https://api.github.com/repos/cozy/cozy-docs-v3/issues/36"},"comments":{"href":"https://api.github.com/repos/cozy/cozy-docs-v3/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cozy/cozy-docs-v3/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/cozy/cozy-docs-v3/statuses/4af8e185891cc6edfe4163256234b965f1949db0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ptbrowne"}}