@autopilot-seo/sdk
v1.1.1
Published
Core Autopilot SEO SDK - Works in any browser, Next.js, React, Vue, or plain HTML
Maintainers
Readme
@autopilot-seo/sdk
Core SDK for Autopilot SEO - Works in browsers, Node.js, React, Next.js, Vue, and vanilla HTML.
Installation
NPM
npm install @autopilot-seo/sdkYarn
yarn add @autopilot-seo/sdkCDN Usage (Static HTML)
<script src="https://unpkg.com/@autopilot-seo/[email protected]/dist/autopilot-seo.umd.js"></script>
<script>
const autopilot = new AutopilotSEO({
apiKey: 'your-api-key',
domain: window.location.hostname,
baseUrl: 'https://api.yourdomain.com'
});
autopilot.register('html').then(config => {
console.log('Registered:', config);
});
</script>NPM Usage
JavaScript
import AutopilotSEO from '@autopilot-seo/sdk';
const autopilot = new AutopilotSEO({
apiKey: 'your-api-key',
domain: 'example.com',
baseUrl: 'https://autopilot-seo-marketing-production.up.railway.app'
});
await autopilot.register('npm');React / Next.js
import AutopilotSEO from '@autopilot-seo/sdk';
import { useEffect } from 'react';
export function useAutopilotSEO(apiKey) {
useEffect(() => {
const autopilot = new AutopilotSEO({ apiKey });
autopilot.register('react');
}, [apiKey]);
}API
Constructor
new AutopilotSEO({
apiKey: string, // Required: Your API key
domain?: string, // Optional: domain name (defaults to window.location.hostname)
baseUrl?: string, // Optional: backend URL (defaults to http://localhost:3001)
pollingInterval?: number // Optional: audit polling interval in ms (defaults to 900000)
})Methods
register(platform?: string)- Register site with Autopilot backendrunAudit()- Trigger a full SEO/AEO/GEO audittrackEvent(eventType: string, metadata?: object)- Track visitor eventsgetSiteId()- Get registered site ID
License
MIT
