Deno.js Bitly API to Create URL Shortener Using deno-bitly Library in TypeScript Full Project For Beginners






is simple module for deno It helps us to make short url with Bitly






Firstival: the module require --allow-net flag



like this



$ deno run --allow-net xxx.ts



Shorten link.



import { Bitly } from "";

// Create Bitly instance and pass the bit ly access token for Authorization
const bitlyClinet = new  Bitly('<Access Token>')

// and you can Create new short link with the code below (pass the long url as 1st argument) 
const shortLink = await bitlyClinet.shorten('')

console.log(shortLink) //


See also  Deno.js Tutorial to Transpile Node.js Packages to Deno Modules Using denolize Library in TypeScript Full Project For Beginners


The options

custom domain:

let shortLinkWithCustomDomain = await bitlyClient.shorten('',{

console.log(shortLinkWithCustomDomain) //<genreated slug>

with some way you can add group_guid on the option (This feature must be available on your bitly account for it to work ):

let shortLinkWithGroup_guid = await bitlyClient.shorten('',{

console.log(shortLinkWithGroup_guid) //<link-id>

Leave a Reply