The Bitly API provides programmatic access to URL shortening and link management services, enabling developers to create, manage, and analyze shortened links, campaigns, and organizations through authenticated REST endpoints.
npm install bitly-api-sdkBitly's Postman Collection was last updated 5/01/22. Please visit our Developer Docs for the most up-to-date information: https://dev.bitly.com/
Contact Support:
https://bitly.is/API-support
Run the following command from your project directory to install the package from npm:
``bash`
npm install bitly-api-sdk@1.0.0
For additional package details, see the Npm page for the bitly-api-sdk@1.0.0 npm.
To validate the functionality of this SDK, you can execute all tests located in the test directory. This SDK utilizes Jest as both the testing framework and test runner.
To run the tests, navigate to the root directory of the SDK and execute the following command:
`bash`
npm run test
Or you can also run tests with coverage report:
`bash`
npm run test:coverage
_Note:_ Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
| --- | --- | --- |
| environment | Environment | The API environment. Environment.Production
Default: |number
| timeout | | Timeout for API calls.0
Default: |Partial
| httpClientOptions | | Stable configurable http client options. |any
| unstableHttpClientOptions | | Unstable configurable http client options. |BearerAuthCredentials
| bearerAuthCredentials | | The credential object for bearerAuth |
The API client can be initialized as follows:
`ts
import { Client, Environment } from 'bitly-api-sdk';
const client = new Client({
bearerAuthCredentials: {
accessToken: 'AccessToken'
},
timeout: 0,
environment: Environment.Production,
});
`
This API uses the following authentication schemes.
* bearer (OAuth 2 Bearer token)`
* Organizationguid
* Campaignguid
* Groupguid
* Webhookguid
* Custombitlink
* Custombitlinks
* Channelguid
* Organizations
* Campaigns
* Preferences
* Bitlinks
* Groups
* Clicks
* Bitlink
* Webhooks
* User
* Channels
* Misc
* HttpClientOptions
* RetryConfiguration
* ProxySettings