This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
lemonSqueezySetup
Caven edited this page Jan 29, 2024
·
1 revision
Initialization configuration.
Only three functions (
activateLicense
,validateLicense
,deactivateLicense
) operate without requiring an API key. To use other functions, you must employlemonSqueezySetup
to configure theapiKey
before utilization.
Create a new API key: https://app.lemonsqueezy.com/settings/api.
import { lemonSqueezySetup } from '@heybrostudio/lemonsqueezy.js'
lemonSqueezySetup({
apiKey: 'Your Lemon Squeezy API Key',
})
import { lemonSqueezySetup } from '@heybrostudio/lemonsqueezy.js'
lemonSqueezySetup({
apiKey: import.meta.env.LEMON_SQUEEZY_API_KEY,
onError(error) {
console.log(error)
},
})
type Config = {
/**
* `Lemon Squeezy` API Key
*/
apiKey?: string
/**
* Fires after a fetch response error
*
* @param error Error
* @returns void
*/
onError?: (error: Error) => void
}
/**
* Lemon squeezy setup.
*
* @param config The config.
* @returns User configuration.
*/
declare function lemonSqueezySetup(config: Config): Config