A pure Dart Pastebin API Wrapper.
This package covers every endpoint disclosed in Pastebin API documentation (as of 16 May, 2022). The following table links the endpoints to the respective package functions:
|Publishes a paste (with support for optional parameters) in Pastebin.|
|Retrieves and refreshes user API key (not developer key).|
|Fetches an user pastes, with support for limiting how many pastes are returned.|
|Deletes an user paste.|
|Obtains user information and settings.|
|Gets the raw paste (full text) of a user paste.|
|Gets the raw paste (full text) of paste.|
There is also support for multiple API key ingestion, a neat feature for making sure that pastes are published, even if you are rate limited by Pastebin.
// Using Official Pastebin API with a single API Dev Key var pastebinClient = withSingleApiDevKey( apiDevKey: primaryApiDevKey, ); // Using Official Pastebin API with multiple API Dev Key pastebinClient = withMultipleApiDevKey( apiDevKeys: [ primaryApiDevKey, fallbackApiDevKey1, fallbackApiDevKey2, ... fallbackApiDevKeyN, ], );
Powered by Dart null sound +
dartz monads, this package is free of null issues and side effects. This is to prevent the throw of any exception that may not be known and caught by developers, and to make sure that information is consistent by contract.
Every HTTP request returns an
Either monad that either returns the response result on the right hand, or
ResponseError instance on the left hand that is typed to each possible Pastebin error (see available errors here).
Why use pastebin.dart?
The main use case that inspired the development of this package, is to provide developers (mostly indie) a way to publish and read app logs for free.
Bugs and Contributions
Found any bug (including typos) in the package? Do you have any suggestion or feature to include for future releases? Please create an issue via GitHub in order to track each contribution. Also, pull requests are very welcome!
This is not an official library/SDK implemented by the Pastebin team, but rather a developer implementation that uses it.