Gadget comes with built-in connections that let you retrieve and manipulate data held in third party systems, without writing code. Each connection instantly provides a real-time, two way data sync between your Gadget backend and the third-party system.
Using connections, a Gadget developer can quickly:
- Listen and react to third party webhooks
- Write data back to third party systems
- Generate performant reports by avoiding rate limits
Although standalone applications can provide utility, most software we build needs to integrate with external systems to provide business value. GitHub integrates with your continuous integration system so that you get feedback on pull requests. Commerce software integrates with warehouse management systems to track inventory.
Building a reliable integration is difficult, often highly repetitive. Once you get past properly authenticating your app, there are lots of issues one has to address when talking to the external system. Webhooks are unreliable, so how do I ensure my system always has the most up-to-date data? Communicating over the network is unreliable, so how do I make actions reliable? How do I respond to specific changes in state?
Additionally, some remote APIs can be difficult to model. For example, Shopify products have many variants as child resources. If you want to model products and product variants separately in your app, you also need to deal with the fact that a product variant being deleted results in a product update payload, with a variants list containing all variants except the one that was deleted.
By providing connections, Gadget takes on this workload on your behalf, so you can start building your business logic sooner.
Gadget connections provide all the things you need to reliably integrate with external systems. There are three major pieces Gadget provides when installing a connection on your Gadget app:
- Data modeling: Gadget will provide models with some connections, and ensure these models are kept up to date with the remote system, through webhooks and background data synchronization.
- Effects: For third-party systems which provide APIs that allow you to run actions on remote systems, such as sending an email, Gadget will provide effects that allow you to easily perform those actions.
- Client: When Gadget doesn't do exactly what you need, an authenticated client is available for your custom code effects to use.
If you no longer need a connection, you can remove it from the Connections view by selecting "Remove Connection". Removing a connection will sever communications between Gadget and the connected resource. However, Gadget will not delete any models or records created by the connection when the connection is removed; any models or records you no longer required can be removed manually.