Airdrop snap-in template

The starter Airdrop snap-in template is available here.

Starting with the template is recommended, as it includes all the necessary boilerplate and structure for a new project.

The template makes use of DevRev’s SDK library, which provides abstraction over the DevRev’s Airdrop control protocol. The SDK simplifies the workflow for data extraction and loading, handling events, state management, and artifacts (batches of extracted items).

It provides features such as:

  • Event management: Communication between Airdrop platform and Airdrop snap-in involves messages called events - depending on the type of event, the snap-in performs different actions.
  • State handling: Update and access state in real-time within tasks.
  • Artifact management: Supports batched storage of artifacts.
  • Error & timeout support: Error handling and timeout management for long-running tasks.
  • Type definitions: Structured types for Airdrop control protocol.

Snap-in code structure

If you check the template, you can see that a snap-in is a Node.js project with a specific file structure:

1- manifest.yaml
2- code/
3 - scripts/
4 - src/
5 - fixtures/
6 - functions/
7 - external-system/
8 - extraction/
9 - workers/
10 - attachments-extraction.ts
11 - data-extraction.ts
12 - external-sync-units-extraction.ts
13 - metadata-extraction.ts
14 - index.ts
15 - install_initial_domain_mapping/
16 - loading/
17 - workers/
18 - load-attachments.ts
19 - load-data.ts
20 - index.ts
21 - test-runner/
22 - test/

The manifest.yaml is a configuration file that defines details such as the snap-in’s name, description, version, connection information, and functionality specifics. Adjusting this file is the initial step in the development of a snap-in.

The code/ folder holds the implementation of the snap-in. Inside, the functions/ subfolder includes the logic for retrieving external sync units, extracting data from and loading data to external systems, and mapping between them.

Built with