How to get API key
An API key is required to authenticate server operations with ULDA. To obtain your API key:
- Visit the 0 am Admin Portal.
- Sign in or create an account if you don't have one.
- Navigate to the API Keys section in your account dashboard.
- Generate a new API key and copy it securely.
- Store the API key in an environment variable or secure vault (e.g.,
.env
file) to avoid exposing it in your source code.
Example of using an API key in your code:
import { Ulda } from '@zeroam/ulda'; // Initialize with API key, optional API URL, and dev mode const apiKey = 'your-api-key'; const ulda = new Ulda( apiKey, 'https://api.0am.ch', // Default API URL true // Optional: enable dev mode for debugging );
Security Tip: The ULDA API is public but protected by CORS (Cross-Origin Resource Sharing) to restrict access to authorized domains. The API key identifies your application and must be included in all requests. While the key is used in client-side code, avoid exposing it in publicly accessible source code repositories (e.g., GitHub). Use environment variables or build-time injection to include the key securely in your front-end bundle. For additional security, register your application’s domain in the 0am Admin Portal to enforce CORS restrictions.