Hawk JS version 1.0.5
hawkStrategy { }

hawkStrategy Object

The hawkStrategy object in Hawk JS provides different strategies for generating and submitting sitemaps or updated route links to various search engines. It includes methods for handling different protocols and APIs, ensuring your website's content is efficiently indexed.

Strategies

1.indexNow

Signature:

indexNow: async (routes: string[]) => { ... }

Description:

Uses the IndexNow protocol to quickly index specified routes on search engines like Bing, Yahoo, Yandex, and Yep.

Example:

await hawkStrategy.indexNow(['www.abc.com/updatedRoute1', 'www.abc.com/updatedRoute2']);

2.gIndex

⚠️
Google service account's credential is required. Follow Credential page.

Signature:

gIndex: async (routes: string[]) => { ... }

Description:

Submits specified routes to Google using the Google Indexing API, ideal for pages with JobPosting or Livestream Broadcasting content.

Example:

await hawkStrategy.gIndex(['www.abc.com/updatedRoute1', 'www.abc.com/updatedRoute2']);

3.gWebmaster

⚠️
Google service account's credential is required. Follow Credential page.

Signature:

gWebmaster: async (
  prettify: boolean = true,
  lookupPatterns: string[] = [],
  ignorePattern: string[] = []
) => { ... }

Description:

Generates sitemap.xml and submits it to Google Search Console. This strategy is suitable for all types of websites.

Example:

await hawkStrategy.gWebmaster(true, ['**/*.html'], ['node_modules/**']);

4.gWebmaster2

⚠️
Google service account's credential is required. Follow Credential page.

Signature:

gWebmaster2: async (
  prettify: boolean = true,
  lookupPatterns: string[] = [],
  ignorePattern: string[] = []
) => { ... }

Description:

Similar to gWebmaster, but also checks the submission status after uploading the sitemap to Google Search Console.

Example:

await hawkStrategy.gWebmaster2(true, ['**/*.html'], ['node_modules/**']);

Usage

Each strategy function can be used independently to handle specific SEO tasks. They provide flexibility in how sitemaps are generated and submitted, ensuring that your content is kept up-to-date across different search engines.

Conclusion

The hawkStrategy object in Hawk JS offers a range of powerful strategies to help you manage your website’s SEO efficiently. By leveraging these strategies, you can ensure your content is indexed quickly and accurately by major search engines.




Keywords:
  • website indexing
  • content visibility
  • search engines
  • bing
  • google