1.0.5 • Published 1 year ago
urlcutjs v1.0.5
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 }
}