Authentication
All API requests require thex-api-key header. You can use either key type:
- Secret key (
i2g_sk_…) — for server-side requests. Generated from the Secret Keys section in your dashboard. - Public key (
i2g_pk_…) — for client-side (browser) requests. Generated from the Websites section. Must include a validOriginheader matching the registered domain.
When to Use the API Instead of the SDK?
- Environment Limitations: If your environment doesn’t support npm (e.g., a non-JavaScript runtime).
- Direct Control: If you need direct control over HTTP requests for specific use cases that the SDK doesn’t cover.
- Lightweight Needs: If you want to avoid adding an additional dependency to your project.