@collectivtech/alana-sdk-js / index / default
Function: default()
default(
options,secretKey?):AlanaApi|AlanaServerApi
Defined in: src/index.ts:25
Create a new entry to the ALANA Platform API using your API key and username.
To create a new entry point for the ALANA Platform's Protected API, set the server option in the options argument to true, and pass your Alana API secret key as the second argument to this function. The Protected API is intended to be server-only, as it allows for destructive operations such as deleting products. Therefore, this method will throw an error if used in the browser in production mode to create a Server SDK instance.
Parameters
options
The options to use when creating this SDK instance. These include the API key and username, the mode (development or production), and further customization for specialized use cases.
secretKey?
string
Your API secret key. This should only be used outside a browser environment, except that in-browser use is allowed in dev and sandbox modes for testing only. Only needed if you are creating a Server SDK instance, so leave it empty if you're just using the Client SDK.
Returns
A new ALANA SDK instance, either Client or Server.