All requests to Gizmo APIs must contain a valid API key.
Get an API key
Create a new API key in the Gizmo dashboard.
Authenticate HTTP Requests
Simply pass the API key in the Authorization header using the Bearer scheme.
Authenticate with the Gimzo SDK
Gizmo publishes type-safe, lightweight SDKs for Typescript and Python.
Install the SDK
npm install @gizmo-os/sdk
Authenticate with Environment Variables
Set the GIZMO_API_KEY environment variable to your API key you created in the Gizmo dashboard. The SDK will automatically use this environment variable to authenticate your requests.
import Gizmo from '@gizmo-os/sdk';
// Uses GIZMO_API_KEY environment variable
export const gizmo = new GizmoSDK();
const application = await gizmo.applications.retrieve('<application-id>')
(Optional) Pass in the API key directly
As an alternative, you can pass the API key directly to the SDK constructor.
import Gizmo from '@gizmo-os/sdk';
export const gizmo = new GizmoSDK({
apiKey: '<your-api-key>',
});
const application = await gizmo.applications.retrieve('<application-id>')
This method is great for local testing and development, but it is not recommended for production environments. Never commit your API key to version control.