Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@integrationos/connections

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@integrationos/connections

IntegrationOS is a fully managed event bus lets you send and receive data across mission-critical cloud apps, databases and warehouses.

latest
npmnpm
Version
1.1.0
Version published
Weekly downloads
4
-50%
Maintainers
3
Weekly downloads
 
Created
Source

@integrationos/connections

A guide on how to use IntegrationOS's modern and lightweight SDK to programmatically manage your Connections.

IntegrationOS's SDK requires an IntegrationOS API Key, which can be created via the settings page in your Developer Dashboard

Getting Started

To start using the IntegrationOS SDK, install the package:

> npm install @integrationos/connections

Initialize

We'll start off by initializing the client, which requires your IntegrationOS API Key. You can specify the environment as either "sandbox" or "production". If you do not specify an environment, the SDK will default to "sandbox".

import { createClient } from '@integrationos/connections';

const client = createClient(process.env.INTEGRATIONOS_API_KEY, {
  environment: "sandbox"
});

Create a Source

Next, we'll create a source using the createSource function. It requires the following parameters:

  • type: Type of Source to create (i.e., Stripe, Shopify, FTP Server, etc..)
  • group: A meaningful and unique group for the data (i.e., Customer ID)
  • label: A human-readable label to easily identify the source later
  • config: Any additional configuration settings (i.e., access credentials)

Here's an example:

import { createSource } from '@integrationos/connections';

const source = await createSource<"stripe">(client, {
  type: "stripe", 
  group: "customer-abc", 
  label: "Production Stripe", 
  config: {
    STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,
  }
});

Set your IntegrationOS Subscriptions

Having set up our source, we'll subscribe to events using the setEvents function. It requires the following parameters:

  • type: Type of Source to create (i.e., Stripe, Shopify, FTP Server, etc..)
  • key: The Source's unique key
  • events: The events you'd like to ingest

Here's an example:

import { setEvents } from '@integrationos/connections';

await setEvents<"stripe">(client, {
  type: "stripe",
  key: source.key,
  events: ["customer.created"],
});

Create a Destination

Next, we'll create a Destination using the createDestination function. It requires the following parameters:

  • type: Type of Destination to create (i.e., Snowflake, Redshift, BigQuery, etc..)
  • group: A meaningful and unique group for the data (i.e., Customer ID)
  • label: A human-readable label to easily identify the destination later
  • config: Any additional configuration settings (i.e., access credentials)

Here's an example:

import { createDestination } from '@integrationos/connections';

const destination = await createDestination<"mongodb">(client, {
  type: "mongodb", 
  group: "customer-abc",
  label: "Production MongoDB",
  config: {
    MONGODB_URI: process.env.MONDODB_URI,
  },
});

License

© 2023, IntegrationOS - Released under the MIT License

Keywords

event-inc

FAQs

Package last updated on 22 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts