Package Installation
- NPM
- Yarn
- pnpm
CDN Installation
For quick prototyping or non-bundled projects, use the CDN:window.Gately.
CDN Options
| Attribute | Description | Default |
|---|---|---|
data-api-key | Your Gately API key | Required |
data-auto-init | Auto-initialize the SDK | true |
data-auto-protect | Auto-enable page protection | true |
Get your API key from Settings → API Keys in your Gately dashboard.
Framework-Specific Setup
React
Next.js
Vue.js
Vanilla JavaScript
Framer Integration
For Framer sites, add the SDK via custom code:- Open your Framer project
- Go to Site Settings > General > Custom Code
- Add to the
<head>section:
- Use in code overrides:
Webflow Integration
- Go to Project Settings > Custom Code
- Add to the Head Code section:
- Add to the Footer Code section:
Verifying Installation
After installation, verify the SDK is working:Troubleshooting
Module not found
Module not found
Ensure you’ve installed the package:
Invalid API key
Invalid API key
- Check that your API key starts with
gately_pk_(public) orgately_sk_(secret) - Verify it matches your project in the dashboard
- Ensure you’re using the correct key type for your environment
CORS errors
CORS errors
- Ensure your domain is added to the allowed origins in project settings
- Check that you’re using HTTPS in production
SDK not loading (CDN)
SDK not loading (CDN)
- Check browser console for errors
- Verify the script URL is correct
- Ensure
deferattribute is present
