Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@mishguru/geniuslink

Package Overview
Dependencies
Maintainers
10
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mishguru/geniuslink

> GeniusLink API wrapper for Node.js

Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
3
-75%
Maintainers
10
Weekly downloads
 
Created
Source

GeniusLink API wrapper for Node.js

Installation

npm install @mishguru/geniuslink

Usage

import { initGeniusLink, getTotalLinkClicks } from '@mishguru/geniuslink'

initGeniusLink({
  key: process.env.GENIUSLINK_API_KEY,
  secret: process.env.GENIUSLINK_API_SECRET,
})

getTotalLinkClicks('a1b2c3')
  .then(console.log)

Documentation

All of the following functions can be imported from @mishguru/geniuslink.

This must be called to declare the API key/secret and initiate the library.

import { initGeniusLink } from '@mishguru/geniuslink'

initGeniusLink({
  key: process.env.GENIUSLINK_API_KEY,
  secret: process.env.GENIUSLINK_API_SECRET,
})

addGroup

Create a new group

import { addGroup } from '@mishguru/geniuslink'

const groupName = 'best-links-ever'

addGroup(groupName)
  .then((groupId) => {
    // groupId === 33118
    ...
  })

addLinkToGroup

Create a new tracked link with a specific group

import { addLinkToGroup } from '@mishguru/geniuslink'

const url = 'https://mish.guru'
const groupId = 12345

addLinkToGroup(url, groupId)
  .then((shortcode) => {
    // shortcode === '0zs3at'
    ...
  })

getTotalLinkClicks

Get the total number of clicks on a specific link

import { getTotalLinkClicks } from '@mishguru/geniuslink'

const shortcode = 'r93n5'

getTotalLinkClicks(shortcode)
  .then((count) => {
    // count === 472
    ...
  })

getGroupDetailsByName

Get details of a group based on the group name

import { getGroupDetailsByName } from '@mishguru/geniuslink'

const name = 'default'

getGroupDetailsByName(name)
  .then((group) => {
    // group.id === '1234'
    ...
  })

getGroupDetailsById

Get details of a group based on the group id

import { getGroupDetailsByName } from '@mishguru/geniuslink'

const id = '1234'

getGroupDetailsBId(id)
  .then((group) => {
    // group.name === 'default'
    ...
  })

FAQs

Package last updated on 21 Nov 2017

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