A JavaScript library for interacting with the LinkerBot API
Go to linkerbot.xyz/developers and create your API token.
const { Client } = require("linker.js");
const client = new Client({
token: "<my-api-token>",
});
client.getLink("<link-id>").then((link) => {
console.log(link);
});
The function will return:
- original (The original link)
- short (The shorted id for the link)
- user (The id of the owner)
- clicks (The number of clicks)
- timeStamp (Such as createdAt and updatedAt)
client.getUserLinks("<user-id>").then((u) => {
console.log(u);
});
This will return all the users links, BUT if the user have private links. Then it wan't return them.
client.create("<url>").then((link) => {
console.log(link);
});
Make sure your link is valid or you will get errors.