0.0.3 • Published 11 months ago

@gitlab/application-sdk-node v0.0.3

Weekly downloads
-
License
-
Repository
gitlab
Last release
11 months ago

GitLab Application SDK - Node

This SDK is for using GitLab Application Services with Node.

How to use the SDK

Using the NPM package

Add the NPM package to your package JSON using your preferred package manager:

yarn add @gitlab/application-sdk-node

OR

npm i @gitlab/application-sdk-node

Initialize SDK

import { GitLabSDK } from '@gitlab/application-sdk-node';

const glSDK = new GitLabSDK({ app_id: 'YOUR_APP_ID', host: 'YOUR_HOST' });

SDK initialization options

OptionDescription
app_idThe ID specified in the GitLab Project Analytics setup guide. It ensures your data is sent to your analytics instance.
hostThe GitLab Project Analytics instance specified in the setup guide.

Methods

identify

Used to associate a user and their attributes with the session and tracking events.

glSDK.identify('123abc', { user_name: 'Matthew' });
PropertyTypeDescription
user_idStringThe ID of the user.
user_attributesHashOptional. The user attributes to add to the session and tracking events.

track

Used to trigger a custom event.

glSDK.track(event_name, event_attributes);
PropertyTypeDescription
event_nameStringThe name of the custom event.
event_attributesHashThe event attributes to add to the tracked event.

Developing with the devkit

To develop with a local Snowplow pipeline, use Analytics devkit's Snowplow setup.

Contribute

Want to contribute to the GitLab Application SDK - Node? follow contributing guide.

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago