{"id":15289238,"url":"https://github.com/brianpunzalan/gatsby-source-espocrm","last_synced_at":"2025-04-10T05:36:01.967Z","repository":{"id":57244950,"uuid":"165864651","full_name":"brianpunzalan/gatsby-source-espocrm","owner":"brianpunzalan","description":"Gatsby Source Plugin for EspoCRM","archived":false,"fork":false,"pushed_at":"2021-08-11T06:09:20.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T06:51:59.003Z","etag":null,"topics":["espocrm","gatsby-plugin","gatsby-source-plugin","gatsbyjs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/gatsby-source-espocrm","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianpunzalan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-15T14:26:11.000Z","updated_at":"2025-01-21T21:24:46.000Z","dependencies_parsed_at":"2022-09-01T06:30:24.679Z","dependency_job_id":null,"html_url":"https://github.com/brianpunzalan/gatsby-source-espocrm","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpunzalan%2Fgatsby-source-espocrm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpunzalan%2Fgatsby-source-espocrm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpunzalan%2Fgatsby-source-espocrm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianpunzalan%2Fgatsby-source-espocrm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianpunzalan","download_url":"https://codeload.github.com/brianpunzalan/gatsby-source-espocrm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248164174,"owners_count":21058097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["espocrm","gatsby-plugin","gatsby-source-plugin","gatsbyjs"],"created_at":"2024-09-30T15:59:57.311Z","updated_at":"2025-04-10T05:36:01.940Z","avatar_url":"https://github.com/brianpunzalan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gatsby-source-espocrm\n\nSource plugin for pulling entity data from EspoCRM.\n\nPulls data from an EspoCRM site with the use of their API specification that could be found [here](https://www.espocrm.com/documentation/development/api/).\n\nYou could checkout their [demo](http://demo.espocrm.com/advanced/).\n\n## Install\n\n`npm install --save gatsby-source-espocrm`\n\n## How to use\n\n```javascript\n// In your gatsby-config.js\nmodule.exports = {\n  plugins: [\n        {\n        resolve: `gatsby-source-espocrm`,\n        options: {\n            baseUrl: `http://my-espocrm-site.com/`, // domain of your EspoCRM site. Please check NOTE below.\n            apiBase: `api/v1/`, // this could be changed if you have different api implementation, say api/v2.\n            username: `\u003cyour username\u003e`, // auth username.\n            password: `\u003cyour password\u003e`, // auth password.\n            schema: [ // list of entities you want to get data from.\n              {\n                name: 'Account',      // \u003cname\u003e field is required. Should be the name of the entity\n                hasMany: ['contacts'] // \u003chasMany\u003e field is optional. This would fetch also the related entities on 'Account'\n              },\n              {\n                name: 'Contact'\n              }\n            ]\n        }\n    }\n  ],\n}\n```\nThis would fetch all data from the list of `entityTypes` declared and generate nodes. Specify the `schema` of the EspoCRM backend you want to be fetched into GraphQL (`please see comments on each line`). It would also terminate the session after `Build` process has been done to prevent multiple unclosed sessions.\n\n## How to query\n\nYou can query nodes created from EspoCRM with the following:\n\n```graphql\n{\n  allGatsbyEspoAccount {\n    edges {\n      node {\n        id\n        espo_id\n        name\n        contacts\n        ...\n      }\n    }\n  }\n}\n```\n\nYou could check more functions in GraphiQL like querying for a single node, etc.\n\nYou could generate pages based on the newly created nodes in your project's `gatsby-node.js`.\n\n## Note\n\n- You should resolve `CORS` issue by yourselves. I suggest putting the built code into the same domain of the website or custom configure your EspoCRM site to allow specific domains to have API access if you want them to be seperated.\n- If you want to customized the generation of the fields on each node, use `gatsby-node.js` of your project.\n- This plugin was developed with reference to [gatsby-source-drupal](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-drupal).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianpunzalan%2Fgatsby-source-espocrm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianpunzalan%2Fgatsby-source-espocrm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianpunzalan%2Fgatsby-source-espocrm/lists"}