Build a connector
We welcome all contributions to Panora; from small UI enhancements to brand new integrations. We love seeing community members level up and give people power-ups!
Introduction
Setup your environnement
We made a docker file that builds Panora from sources, specifically to help you locally test your contributions. Here’s how to use it.
Copy env variables
bash cp .env.example .env
Removed previously installed dependencies
That’s all! You can find the backend and other services running at their usual location. Editing code locally will immediately reflect.
Adding new Integrations ✨
Make sure you are inside packages/api/src
where the server lives !
You want to add a new 3rd Party not yet supported ? 🧑🎤
Ie: Slack, Hubspot, Jira, Shopify …
First choose wisely which vertical the 3rd party belongs to among these:
- crm
- ticketing
- accounting
- ats
- file_storage
- hris
- marketing_automation
For the sake of the guide, now on we’ll consider adding a 3rd party belonging to the crm
vertical.
1. Look into the packages/shared/src/utils.ts
file and check if the provider you want to build has its metadata set inside the providersConfig
object.
It should be available (if not contact Panora team) with active field set to false meaning the integration has not been built.
Actually an integration is built in 2 parts :
- the authentication part (oauth, api key, basic etc) which is built by the Panora team
- the service integration where the mapping is created with our unified model which is what you’ll build
2. Build your provider service
You want to map a common object to your new 3rd Party ? 👩🎤
Ie: Contact, Ticket, Deal, Company …
For the sake of this guide, let’s map the common object contact
under crm
vertical to my3rdParty (in reality it would be a real 3rd party name).
DISCLAIMER: an integration is considered valid when all common objects have been mapped. Then, after the PR is accepted we’ll be able to set active
field to true
inside providersConfig
.
1. Add a new service to map your common object to your 3rd party
Create a new service folder with the name of your 3rd party. Let’s call it my3rdParty.
cd crm/contact/services/my3rdParty
You’ll now create 3 files.
index.ts
_where your service is created and direct interaction with your 3rd party API is handled
It must implement the IContactService
interface.
Check other implementations under /crm/contacts/services
to fill the core functions.
The keen readers may have noticed 3rdPartyContactInput
and 3rdPartyContactOutput
.
This is where types.ts
comes in:
Go to the 3rd party API and insert the correct types asked by the API.
Last but not least, inside mappers.ts
you have to build the mappings between our unified common object contact
and your third party specific type 3rdPartyContact
.
It must implement IContactMapper
interface.
Check other implementations under /crm/contacts/services
to fill the core functions.
2. Enable your new service
To make sure the service is enabled, dependencies and imports must be added. We built a script that does it in seconds.
pnpm run validate-connectors --vertical="crm" --objectType="contact"
The script will automatically scan the /crm/contact/services
folder and detect any new service folder so all dependencies and imports are updated across the codebase.