Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Merge connection example #22

Merged
merged 3 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions javascript/connect-alpha/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# @flatfile/plugin-connect-via-merge

This is an **alpha release** connect plugin for Merge.dev. Using this plugin will enable you to sync data from hundreds of integrations (connected through Merge.dev) with Flatfile.

## Before you begin...

1. Email [email protected] to request that the `connections` flag be enabled for your account.
2. Create a [Merge.dev](https://www.merge.dev) account.
4. Create and configure a [Flatfile Space](https://platform.flatfile.com).
3. Create a new secret named `MERGE_ACCESS_KEY` in your space containing your [Merge.dev API key](https://app.merge.dev/keys).

## Getting started

First, install the plugin:
```bash
npm i @flatfile/plugin-connect-via-merge
```

Now you can create your Flatfile listener:

Javascript:
```js
import mergePlugin from "@flatfile/plugin-connect-via-merge";

export default function (listener) {
listener.use(mergePlugin());
}
```

Typescript:
```ts
import type { FlatfileListener } from "@flatfile/listener";
import mergePlugin from "@flatfile/plugin-connect-via-merge";

export default function (listener: FlatfileListener) {
listener.use(mergePlugin());
}
```

And finally, deploy it to Flatfile:

```bash
npx flatfile@latest deploy
```

With the `connections` feature flag enabled, you will see a new item in your space's sidebar labeled "Add Connection". Clicking this will open a modal where you can select the Merge.dev integration you want to connect to Flatfile. After you've made your selection, Merge.dev will since your selected integration with their system and your Flatfile listener will create a Workbook with Sheets to match Merge.dev's schema. Once the Merge.dev sync is complete, your Flatfile listener will complete the process by syncing with Merge.dev.
5 changes: 5 additions & 0 deletions javascript/connect-alpha/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { mergePlugin } from "@flatfile/plugin-connect-via-merge";

export default function flatfileEventListener(listener) {
listener.use(mergePlugin());
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@flatfile/plugin-xml-extractor": "^0.5.0",
"@flatfile/plugin-zip-extractor": "^0.3.6",
"@flatfile/util-response-rejection": "^0.1.0",
"@flatfile/plugin-connect-via-merge": "^0.1.0",
"axios": "^1.5.0",
"flatfile": "^3.5.9",
"form-data": "^4.0.0",
Expand Down
46 changes: 46 additions & 0 deletions typescript/connect-alpha/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# @flatfile/plugin-connect-via-merge

This is an **alpha release** connect plugin for Merge.dev. Using this plugin will enable you to sync data from hundreds of integrations (connected through Merge.dev) with Flatfile.

## Before you begin...

1. Email [email protected] to request that the `connections` flag be enabled for your account.
2. Create a [Merge.dev](https://www.merge.dev) account.
4. Create and configure a [Flatfile Space](https://platform.flatfile.com).
3. Create a new secret named `MERGE_ACCESS_KEY` in your space containing your [Merge.dev API key](https://app.merge.dev/keys).

## Getting started

First, install the plugin:
```bash
npm i @flatfile/plugin-connect-via-merge
```

Now you can create your Flatfile listener:

Javascript:
```js
import mergePlugin from "@flatfile/plugin-connect-via-merge";

export default function (listener) {
listener.use(mergePlugin());
}
```

Typescript:
```ts
import type { FlatfileListener } from "@flatfile/listener";
import mergePlugin from "@flatfile/plugin-connect-via-merge";

export default function (listener: FlatfileListener) {
listener.use(mergePlugin());
}
```

And finally, deploy it to Flatfile:

```bash
npx flatfile@latest deploy
```

With the `connections` feature flag enabled, you will see a new item in your space's sidebar labeled "Add Connection". Clicking this will open a modal where you can select the Merge.dev integration you want to connect to Flatfile. After you've made your selection, Merge.dev will since your selected integration with their system and your Flatfile listener will create a Workbook with Sheets to match Merge.dev's schema. Once the Merge.dev sync is complete, your Flatfile listener will complete the process by syncing with Merge.dev.
6 changes: 6 additions & 0 deletions typescript/connect-alpha/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { FlatfileListener } from "@flatfile/listener";
import { mergePlugin } from "@flatfile/plugin-connect-via-merge";

export default function flatfileEventListener(listener: FlatfileListener) {
listener.use(mergePlugin());
}