Skip to content

UrlcutAccount/Urlcutjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Urlcutjs

This is the official Urlcut NPM package.

Install

npm install urlcutjs

Usage

const UrlcutClient = require("urlcutjs");
const Client = new UrlcutClient("API-Key");
// TypeScript/ES Module support
import UrlcutClient from "urlcutjs";
const Client = new UrlcutClient("API-Key");

How to shortend a link

Client.Create("https://www.example.com")
  .then((data) => console.log(data))
  .catch((err) => console.error(err));

Output

{
  "success": true,
  "shortened": "CxTYCb",
  "domain": "example.com",
  "credits": 0.4
}

How to delete an existing short link

Client.Delete("Example-Short")
  .then((data) => console.log(data))
  .catch((error) => console.error(error));

Output

{
  "success": true
}

How to get the analytics of a short link

Client.Analytics("Example-Short")
  .then((data) => console.log(data))
  .catch((error) => console.error(error));

Output

{
  "success": true,
  "countriesOfTheUsers": [ { "DE": 1 } ],
  "usersDeviceType": { "PC": 1, "PHONE": 0 }
}

Contributors

Contributors

About

Official Urlcut API public NPM package.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published