You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@gitlab/application-sdk-node

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gitlab/application-sdk-node

NodeJS SDK for GitLab Application services

0.0.3
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
6
Weekly downloads
 
Created
Source

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.

Keywords

GitLab

FAQs

Package last updated on 02 Jun 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