If you prefer a typed experience over calling http endpoints directly, you can use our sdkDocumentation Index
Fetch the complete documentation index at: https://docs.unprice.dev/llms.txt
Use this file to discover all available pages before exploring further.
@unprice/api.
Install
Unprice Api key
When creating, revoking or updating resources, you will need your api key — you can create a new one in the settings of your project. Afterwards you need to provide it to the client:if you suspect it has been compromised.
Response format
Because forgetting to handle thrown errors properly in javascript is often forgotten, we have decided to explicitly return errors to be handled. Fortunately typescript helps us here and everything is typesafe. Every method returns either anerror or a result field, never both and never none.
Checking for errors
To check for errors you use theerror property, our errors are easy to read and provide a link to our documentation for more information.
Options
The constructor accepts some options to customize the behavior:Base Url
Run all requests against your own instance of unprice hosted on your own infrastructure.Retries
By default the client will retry on network errors, you can customize this behavior:retry
Cache
Configure thefetch cache behavior.
Available options are:
default, force-cache, no-cache, no-store, only-if-cached or reload.
