npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@event-inc/connections

v2.3.6

Published

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

Downloads

19

Readme

@event-inc/connections

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

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

Getting Started

To start using the Event SDK, install the package:

> npm install @event-inc/connections

Initialize

We'll start off by initializing the client, which requires your Event 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 '@event-inc/connections';

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

Create a Source

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

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

Here's an example:

import { createSource } from '@event-inc/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 Event Subscriptions

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

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

Here's an example:

import { setEvents } from '@event-inc/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:

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

Here's an example:

import { createDestination } from '@event-inc/connections';

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

License

© 2023, Buildable Technologies Inc. - Released under the MIT License