Links

Destinations

A guide on how to use Event's modern and lightweight SDK to programmatically manage your Destinations of data
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:
Node.js
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".
Node.js
import { createClient } from '@event-inc/connections';
const client = createClient(process.env.EVENT_INC_API_KEY, {
environment: "sandbox"
});

Create a Destination

Next, we'll create a Destination using the createDestination function. Here's an example:
JavaScript
TypeScript
import { createDestination } from '@event-inc/connections';
const destination = await createDestination(client, {
type: "mongodb",
group: "customer-abc",
label: "Production MongoDB",
config: {
MONGODB_URI: process.env.MONDODB_URI,
},
});
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,
},
});
The createDestination function requires the following parameters:
Name
Required
Description
type
Type of Destination to create (i.e., Postgres, 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)
A successful response from createDestination will confirm the MongoDB destination has been set up.
{
_id: 'conn_dst_MTY4NjE2ODE1NzM0MA::ZjQzMmQ3NzAtMDNhNi00Y2RjLWFlNTktNzM0OWQ0Y2QzYjc4',
_v: '1.0.0',
name: 'Production MongoDB',
slug: 'production-mongodb-00448d',
type: 'mongodb',
group: 'customer-abc',
label: 'Production MongoDB',
key: 'destination::mongodb::customer-abc',
identifiers: {
live: 'id_live_1_e0EWVqgK3fGUT9OQtKotGIIM6h5AD59aHIV7lgD11nwWMFKo5Kd89blEUJ33feZNvbpZl5jUs93zzZVlLOKDUytQo-_tRmdRS5hCCdRNdF8cfz-KFRzOb__KS7MRIXmo7VdNxVRGVagApbuFN_4cWKwXms69nxremMyHfN9Pi8Q9tn2aWsVw86Ff'
},
integrationDefinitionId: 'conn_def_dst_395eda6862f544ec9250fa4f342d20b8',
integrationApiVersion: 'NA',
destinationType: 'http',
createdAt: 1686168157340,
createdDate: '2023-06-07T20:02:37.340Z',
active: true,
deleted: false,
deprecated: false
// ...
}
Last modified 3mo ago