# adonis-bitly

> Bitly shorten for AdonisJS Framework

Latest version **1.0.1** (published 2019-04-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install adonis-bitly
pnpm add adonis-bitly
yarn add adonis-bitly
bun add adonis-bitly
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-04-10 |
| First published | 2019-04-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | agung96tm |
| Maintainers | agung96tm |
| Keywords | adonisjs, bitly, javascript, package, framework, shorten, url |

## Links

- npm: https://www.npmjs.com/package/adonis-bitly
- Repository: https://github.com/agung96tm/adonis-bitly
- Homepage: https://github.com/agung96tm/adonis-bitly#readme
- Issues: https://github.com/agung96tm/adonis-bitly/issues
- npm.io page: https://npm.io/package/adonis-bitly

## Dependencies (2)

- [bitly](https://npm.io/package/bitly.md) 6.0.8
- [@adonisjs/generic-exceptions](https://npm.io/package/@adonisjs/generic-exceptions.md) ^2.0.1

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-04-10
- 1.0.0 — 2019-04-10

## README

# Adonis Bitly

This package is an **shorten url** built on top of [node-bitly](https://github.com/tanepiper/node-bitly).

## Getting Started

Install the package using the `adonis` CLI.

```bash
> adonis install adonis-bitly
```

Instruction: ([Click Here](https://github.com/agung96tm/adonis-bitly/blob/master/instructions.md)).


## Configure

Configure token inside the `config/bitly.js`
```js
const Env = use('Env')

module.exports = {
  // set in here
  accessToken: Env.get('BITLY_TOKEN', 'fixthistoken')
}
```

or inside the `.env`
```js
BITLY_TOKEN=7ab070f4e5xxxx0bac67xxxx24249b3b0606xxxx
```


## Usage

Just make long become short:

```js
// Controller
const Bitly = use('Bitly')

async index() {
  // get short url
  const result = await Bitly.shorten('https://github.com/agung96tm/adonis-bitly/')

  // example: http://bit.ly/2uWbQfS
  return result
}
```

If You need more detail:

```js
// Controller
const Bitly = use('Bitly')

async index() {
  // get detail url (set true)
  const result = await Bitly.shorten('https://github.com/agung96tm/adonis-bitly/', true)

  /**
   * example:
    {
      "url": "http://bit.ly/2UbtGSS",
      "hash": "2UbtGSS",
      "global_hash": "2UeD4xW",
      "long_url": "https://github.com/agung96tm/adonis-bitly/",
      "new_hash": 0
    }
   */
  return result
}
```


## How Can I Get Token
1. Login to https://bitly.com/
2. Open Your 'Edit Profile'
3. Click 'Generic Access Token'
4. Insert Your Password Bitly Password (if you login with google / facebook, try to reset password)
5. You will get that token

---
_Source: https://npm.io/package/adonis-bitly · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
