SEO & INDEXING

Automate Your Sitemap.xml

Generate, update, and manage compliant XML sitemaps programmatically. Keep search engines perfectly in sync with your site's content without manual effort.

Join waitlist

sitemap.xml

import { D } from '@do-inc/sdk';

// Initialize the .do client
const d = new D('YOUR_API_KEY');

// Define the URLs for your sitemap
const urls = [
  { loc: 'https://example.com/', lastmod: '2023-10-26', changefreq: 'daily', priority: 1.0 },
  { loc: 'https://example.com/about', lastmod: '2023-10-20', changefreq: 'monthly', priority: 0.8 },
  { loc: 'https://example.com/blog/new-post', lastmod: '2023-10-25', changefreq: 'weekly', priority: 0.9 }
];

// Generate the sitemap.xml content
const sitemapContent = await d.sitemap.xml.generate({ urls });

console.log(sitemapContent);
// Returns the complete, formatted sitemap.xml file content as a string.

Deliver economically valuable work

Frequently Asked Questions

Do Work. With AI.