linker.js

2.0.2 • Public • Published

Linker.js

A JavaScript library for interacting with the LinkerBot API

Get your API token

Go to linkerbot.xyz/developers and create your API token.

Creating the Client

const { Client } = require("linker.js");

const client = new Client({
  token: "<my-api-token>",
});

Get a link

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)

Get Users Links

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.

Creating a new link

client.create("<url>").then((link) => {
  console.log(link);
});

Make sure your link is valid or you will get errors.

Package Sidebar

Install

npm i linker.js

Weekly Downloads

1

Version

2.0.2

License

ISC

Unpacked Size

4.22 kB

Total Files

5

Last publish

Collaborators

  • themrdev